Moveable/Resizable "Box" views and blurry frame
Moveable/Resizable "Box" views and blurry frame
- Subject: Moveable/Resizable "Box" views and blurry frame
- From: Yann Bizeul <email@hidden>
- Date: Mon, 30 Jul 2007 17:34:23 +0200
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:
This email sent to email@hidden