Re: Moveable/Resizable "Box" views and blurry frame
Re: Moveable/Resizable "Box" views and blurry frame
- Subject: Re: Moveable/Resizable "Box" views and blurry frame
- From: "Clark Cox" <email@hidden>
- Date: Mon, 30 Jul 2007 10:34:35 -0700
On 7/30/07, Yann Bizeul <email@hidden> wrote:
> Hello list,
>
> I'm working on an application that provides some kind of layout to
> arrange boxes on a page, like in a sketch application.
>
> As long as I do not zoom my view, I can get everything to work just
> fine, moving the view, resize with handles, etc...
>
> But I need to provide a zoom feature, which I implemented using
> scaleUnitSquareToSize on the contentView of my NSScrollView.
>
> The side effect is that, if a coordinate in the middle of the pixel (.
> 5) in 1:1 ratio is ok to draw a one pixel clear line, this is no
> longer applicable when the view is zoomed.
The problem is that, when zoomed, 0.5 is no longer in the middle of a
pixel. You have to scale that offset
See: <http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaDrawingGuide/Transforms/chapter_4_section_2.html>,
especially the section titled "Pixel-Exact Drawing"
--
Clark S. Cox III
email@hidden
_______________________________________________
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