• 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: Subviews becoming blurry or "chopped up"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Subviews becoming blurry or "chopped up"


  • Subject: Re: Subviews becoming blurry or "chopped up"
  • From: Rosyna <email@hidden>
  • Date: Thu, 11 May 2006 05:12:52 -0700

Ack, at 5/11/06, Ricky Sharp said:

On Thursday, May 11, 2006, at 06:16AM, Rosyna <email@hidden> wrote:

Ah, so then it is indeed a bug in AppKit wrt fractional parts. Of
course, NSIntegralRect() cannot be used going into the future as it
breaks when using a Resolution Independent UI.

I don't think that's the case. When drawing the final content to the screen, you want things to always fall on pixel boundaries. My app makes use of NSIntegralRect, floor, ceil, etc. when drawing images, bezier paths and text. Content is scaled correctly, although at a few scaling factors, there can be artifacts around edges. I have a bug filed on this.

Although this doesn't quite go along with reasons why frames are floating point. For example, if you have a screen set to 144dpi then an object 72 virtual units high will have one real pixel per .5 virtual units. In order to express this and to *actually* get a higher dpi, fractional parts are used.


Pixel boundaries and virtual unit boundaries are not the same thing.

From the documentation:

"At the API level, the window must appear to the application to be 200 virtual units tall even if the onscreen representation is (for example) 267 screen pixels tall. "

>Although AppKit has
these same drawing issues when setting a multiplier on the Resolution
using Quartz Debug.

The issue here is that non-scalable content is being used to render some or all of the controls/views. All graphical portions of a button, for example, appear to be bitmapped images. The end-caps need to scale in both x and y directions and thus will mostly appear with jaggies. The center only needs to scale in the y and the results of scaling is mostly good. Of course the text is scaled beautifully. Focus rings are another area of problems as they often leave drawing artifacts when scaled. I have bugs filed about these too.

I'm not seeing any jaggies. There were none in that screenshot. However, if one part of the button was being snapped to whole pixels and another part was not, this would reproduce what I am seeing. Or worse, if they were snapped to different whole pixels.


Having or not having Higher resolution images wouldn't change anything about what I'm seeing. Since the original screenshot I posted was at 72dpi. I was merely using Hi DPI screens as a reason why chopping off the fractional part of the coords seems like a bad idea in the long run.

When it comes to drawing using a UI scaling factor, OS X just fails miserably at it now. <http://www.unsanity.org/rosyna/imgs/fogbat.png> I'm seeing something there, but jaggies they are not. How odd, when I took that screenshot, there was this nasty grid of lines on the window. But they didn't seem to transfer to the image.

The point being that it can't even draw the images correctly now at 72dpi.
--


Sincerely, Rosyna Keller Technical Support/Holy Knight/Always needs a hug

Unsanity: Unsane Tools for Insanely Great People

It's either this, or imagining Phil Schiller in a thong.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Subviews becoming blurry or "chopped up" (From: Rosyna <email@hidden>)
 >Re: Subviews becoming blurry or "chopped up" (From: "John C. Randolph" <email@hidden>)
 >Re: Subviews becoming blurry or "chopped up" (From: Rosyna <email@hidden>)
 >Re: Subviews becoming blurry or "chopped up" (From: Ricky Sharp <email@hidden>)

  • Prev by Date: Re: Programmatically resizing an NSWindow based on window contents
  • Next by Date: Suppressing highlight drawing in an NSTableView
  • Previous by thread: Re: Subviews becoming blurry or "chopped up"
  • Next by thread: Re: Subviews becoming blurry or "chopped up"
  • Index(es):
    • Date
    • Thread