Mailing Lists: Apple Mailing Lists

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

Moveable/Resizable "Box" views and blurry frame



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. I tried messing around with convertRect:fromView: and convertRect:toView: to get pixel in window coordinate, round it, and ask the value back in view coordinates without sucess, it seems convertion methods do not handle correctly the zoom level applied to the view.

Another ting I may doing wrong is I intercept setFrame to move the view at the right place, but maybe I should move the view the same value as the pointer offset from the beginning of the drag, and try to draw my stuffs "at the pixel" in drawRect: method

I would be happy to get some pointers to sample codes or advice from people that did already implement this kind of things.

Thanks


Yann Bizeul - yann at tynsoe.org Cocoa Developer

Tynsoe Projects
BuddyPop - GeekTool - SSH Tunnel Manager - ...
http://projects.tynsoe.org/


_______________________________________________

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


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.