NSButton Blurry on El Capitan but not Yosemite

In one of my apps, I'm noticing a couple of my buttons have text that are blurry on El Capitan but are not blurry on Yosemite.


I've logged out the frames. It seems that on El Capitan the button frames are not aligned on the pixel grid. It is a strange though that the same code on Yosemite does not result in a blurry button. Did the system automatically fix this issue on Yosemite?

Replies

Are you using a non-Retina Mac? I have a MacBook Air, and I'm continually surprised by the number of lame pixel-alignment issues that seem to have been simply overlooked because almost everone now uses Retina. For example, the search field in the Mac App Store has been a half-pixel too low for several releases now, even the GM.


Now as for your specific case, you might try checking your nib or storyboard to see if there are any half-pixel misalignments in your autolayout setup. Just using "Update Frames" on everything has straightened out the issue for me.

Yeah, I have a non-retina Mac.


These buttons are created programmatically. They are layer backed (not bordered). I created them programmatically because I always get terrible results when using layer backed anything in Interface Builder. On Yosemite, the way for me to not get blurry buttons was to create them programmatically. Now they are blurry on el capitan...so I have to enforce the frames I guess. Only thing I can think of maybe some default autoresizing behavior in yosemite fixed the issue before...or some default autoreszing behavior in el capitan is taking the frames off the pixel grid.

Are you using Auto Layout or are you still using the old springs-and-struts system?

No autolayout. I calculated the frames manually for these only because generally Appkit does not work with Core Animation very well....and whatever default configurations get set when a layer backed view is loaded out of Interface Builder really produces undesirable results.


Core Animation is required in this view hiearchy, because of my use of ImageKit in this view hierarchy. I changed the code a bit..I rounded the frames values to integers. It looks better now on El Capitan, but for some reason I still think the text looks a little crisper on Yosemite.

So your alignment code worked as expected on Yosemite but not en El Capitan? If you can pin down exactly what's behaving funny, you can report it as a bug so hopefully it will be fixed.


Now about the text, do keep in mind that the system font was changed in El Capitan, so that might be part of the differences you're noticing.

Yeah it's def. not the font because I don't use the system font here. Maybe a change in one of those font drawing configurations perhaps... with regards to being layer backed. If I remember correctly there are a bunch of different options for font drawing in the C Api..smoothing or whatever. I'd have to look.


Forcing integers for all frame values did help, but I don't think it is perfect. I wish Appkit would just draw smooth text always when core animation is turned on...i'd rather sacrifice whatever performance is gained...