Zooming a view, that is contained in an NSScrollView
Zooming a view, that is contained in an NSScrollView
- Subject: Zooming a view, that is contained in an NSScrollView
- From: Nick <email@hidden>
- Date: Mon, 17 Oct 2011 19:47:41 +0300
Hello!
I am trying to implement a simple vector graphics editor.
I have some thoughts on how to implement the elements positioning,
storage and select-ability.
The problem is i don't know how would it be right to implement Zooming
(similar to how graphics editors do it - by allowing the user to
select some area of the view with a selection rectangle, and, after
the mouseUp event happens, zoom in or out the view that is contained
within an NSScrollView.
I still need the original coordinates to be preserved (like, if the
user clicks on a pixel with original coordinates (1;1), on a 10-times
zoomed in view the click on (10;10) should result in (1;1) in the
method mouseDown, for example).
I tried looking at Sketch sample, but its code is actually scary for a
newbie, especially when they use Cocoa Bindings so heavily.
Could you give me some high-level ideas?
As far as I understood, a "Sketch" sample implements this by
subclassing an NScrollView. So maybe there's some simple way? Or
should I implement everything by hand (including this coordinates
transformation (scaling of every mouse event and drawing events)?
Thank you!
_______________________________________________
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