Re: NSWindow setFrame:display: ceiling behavior?
Re: NSWindow setFrame:display: ceiling behavior?
- Subject: Re: NSWindow setFrame:display: ceiling behavior?
- From: Nick Zitzmann <email@hidden>
- Date: Sat, 27 Aug 2011 01:31:16 -0600
On Aug 25, 2011, at 2:36 PM, Arbit Richardi wrote:
> Given the following code snip:
>
> NSRect newFrame = [myWindow frame];
> newFrame.size.width = 772.16;
> [myWindow setFrame:newFrame display:YES];
> NSLog(@"%f", [myWindow frame].size.width);
>
> The output is: 773.000000, and in fact, the window is drawn 773 points
> wide on my MacBook Pro.
>
> Why do windows prefer whole points?
Because at 72 DPI, all AppKit frame coordinates are/should be expressed using integral numbers only. Typically only Bézier paths are drawn with sub-pixel coordinates at that resolution.
> Is there another method that will
> draw windows at non-whole number point sizes?
No. What are you trying to accomplish?
> Is this behavior the
> same on higher-resolution devices?
Maybe. Did you try it? You can see for yourself by running Quartz Debug and choosing "UI resolution" in the Window menu.
Nick Zitzmann
<http://www.chronosnet.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