• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSWindow non-integer point sizes? (on Retina dispays)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >NSWindow non-integer point sizes? (on Retina dispays) (From: "Sean McBride" <email@hidden>)

  • Prev by Date: Leak in NSDocument Edge Case
  • Next by Date: Re: Focus ring of NSComboBox and text field visible through overlaid views
  • Previous by thread: Re: NSWindow non-integer point sizes? (on Retina dispays)
  • Next by thread: Leak in NSDocument Edge Case
  • Index(es):
    • Date
    • Thread