Problem when userSpaceScaleFactor is not 1.0
Problem when userSpaceScaleFactor is not 1.0
- Subject: Problem when userSpaceScaleFactor is not 1.0
- From: "Gary Crandall" <email@hidden>
- Date: Thu, 18 Dec 2008 14:20:50 -0800
I have a situation that I have been unable to solve for several weeks. Inside a view, I am drawing a "box" that shows a "drop down" effect, similar to a drawer. So in the "closed" state it is a narrow rectangle, and when it "opens," it expands into a larger rectangle, with a "drop-down" effect. The effect is created by calling [[self animator]setFrameSize:size]. The result is a nice, smooth "drop down" effect, because the top origin position is pinned to the same location (using Interface Builder "springs and struts").
However, when the userSpaceScaleFactor for the app is set to some fractional value (such as scaling by 1.25), the box is not stable. Instead, the top origin visibly "jumps" around by a pixel or two. I am sure this has something to do with the rounding of fractional pixels, but I have been unable to solve it. Note that this happens only when setting the frame size through the animator (because the result is system calls to setFrameSize), and it only jumps around if the scale factor is not 1.0.
I have tried overriding setFrameSize, and setFrameOrigin, attempting conversions that seem like they should work---all to no avail. No matter what I do, I cannot figure out how to keep the box pinned to the same vertical location during the "animation" of the frame.
Anyone have any ideas?
_______________________________________________
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