Re: NSWindow non-integer point sizes? (on Retina dispays)
Re: NSWindow non-integer point sizes? (on Retina dispays)
- Subject: Re: NSWindow non-integer point sizes? (on Retina dispays)
- From: Ken Thomases <email@hidden>
- Date: Fri, 30 Jun 2017 19:29:54 -0500
On Jun 30, 2017, at 12:26 PM, Sean McBride <email@hidden> 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 (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