I have an NSScrollView
with a variety of sub view types. Some are NSTextViews
, some are NSTextFields
, some are NSButtons
, etc.
When I set the magnification of my NSScrollView
to anything other than 1.0, the focus ring is not drawn over the proper location of the view.
For example, this is what it should look like (scaled at 1.0):
But with a 1.5 magnification, this is what it looks like:
Please note that on Stack Overflow, the images look about the same size, but in the actual screenshot, the 1.5 scaled image is larger. But you get the idea with the focus ring being offset.
To set the magnification, I am using the following code:
[self.scrollView setMagnification:zoomLevel]
So it's pretty simple code. The NSTextView
obviously has its own NSScrollView
surrounding it and that's actually where the focus ring is being draw of course. The same problem exists with just regular NSTextFields
and NSButtons
as you can see in these screenshots:
You can see the button's focus ring is just a blue dot offset from where it should be.
At 1.0 magnification, it all looks normal.
If I use pinch to zoom, you can see the focus ring moving away from the field as the scrollview is zoomed.
Does anyone know what the proper way to use the setMagnification
method of an NSScrollView
should be? It seems like I should be able to just set the value. That does work, but I have these troubles with the focus rings not lining up.
Any help or ideas would be greatly appreciated.
This is on Mac OS X 10.10.1, but it also happens on OS X 10.9.x. and also happened on OS X 10.10.