gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Pixel-aligned autoresizing


From: Jens Ayton
Subject: Re: Pixel-aligned autoresizing
Date: Wed, 6 Jul 2011 10:54:28 +0200

On Jul 6, 2011, at 10:32, Fred Kiefer wrote:
> 
> Basically wee need to ensure that all drawing operations that are
> initiated by the gui drawing code get pixel aligned. Somebody will have
> to test whether this is true for all drawing operations, that is, when I
> use an NSBezierPath with fractional coordinates to draw into a NSView,
> will the result be blurred?

Yes, Cocoa NSBezierPath supports subpixel positioning. In fact, the most common 
question from beginners is why one-pixel rectangles at integer coordinates are 
drawn two pixels wide, and this is the answer.

Developers writing custom views are expected to use -centerScanRect: and 
related coordinate transform functions to ensure grid-aligned drawing under 
transformation and UI scaling, and I assume the standard views do too.


-- 
Jens Ayton




reply via email to

[Prev in Thread] Current Thread [Next in Thread]