Scrolling NSScrollView by fractional amounts - why would values get rounded?
Scrolling NSScrollView by fractional amounts - why would values get rounded?
- Subject: Scrolling NSScrollView by fractional amounts - why would values get rounded?
- From: Martin Redington <email@hidden>
- Date: Thu, 10 Sep 2009 15:01:37 +0100
I've got two NSScrollView's in separate windows, that I'm trying to
scroll programmatically in synchrony.
I'm calling
[[scrollView contentView] scrollToPoint:theNewPoint];
This works fine when the new y value is a whole integer, but I'm
seeing some strange behaviour when trying to scroll by fractional
amount (e.g. .25 or .5 of a pixel).
In one window, the fractional pixel values are respected. If I scroll
the origin from 50.0 to 50.25, its 50.25 when I come to scroll again.
However, in the other window, values seem to get rounded. e.g. If I
scroll from 50.0 to 50.25, the y origin is still 50.0 when I come
round to scroll again. If I scroll from 50.0 to 50.5, then the y
origin actually moves to 51.0
There are a few minor differences in how I'm setting up the windows
(one is extracted fully set up from a nib, while the other has a
manually created NSTextView added to it after it's unarchived), but
inspection of the view hierarchy shows no obvious differences between
the two setups.
Hopefully this is something dumb that I've just overlooked, but if
anyone can point me in the right direction, that would be great ...
cheers,
Martin
--
http://www.mildmanneredindustries.com/
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden