On Jun 30, 2017, at 12:26 PM, Sean McBride <s...@rogue-research.com> wrote:
> 
> Does anyone know what NSWindow's initWithContentRect: behaviour is with 
> non-integer contentRect?  The docs don't say.  It seems that, on a retina 
> display, window size can only be an even number of pixels (ie an integer 
> number of points).

I have experience with this and have seen the same behavior as you.  A window's 
size and position are restricted to integral points.  If you pass a 
non-integral rect, it will be expanded outward to be integral.

I suspect that this is for the situation where a system has a combination of 
Retina and non-Retina displays.  You don't want dragging a window from one to 
the other to change its size.

If your window is borderless, you can make it transparent and have a 
fractional-size view (subview of the contentView) do the base opaque drawing, 
thereby effectively setting the size of the window.

Regards,
Ken

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to