Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Moveable/Resizable "Box" views and blurry frame



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

References: 
 >Moveable/Resizable "Box" views and blurry frame (From: Yann Bizeul <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.