Re: Drawing: The Right place to keep bounds
Re: Drawing: The Right place to keep bounds
- Subject: Re: Drawing: The Right place to keep bounds
- From: Paul Bruneau <email@hidden>
- Date: Wed, 25 Nov 2009 11:40:55 -0500
On Nov 25, 2009, at 11:24 AM, Jens Alfke wrote:
On Nov 25, 2009, at 7:27 AM, Paul Bruneau wrote:
I think I recognize, and I am pretty sure I have read that Sketch
does things Wrong. I see that the shape objects keep their own
bounds (and frame?) information. It seems clear to me that this is
Wrong. What does Sketch do if it ever can have two views of the
same objects?
The bounding box is an intrinsic property of a geometric object,
independent of how it's viewed.
Unless you're talking about something like a bounding box
transformed into view coordinates; I'm not familiar with the Sketch
code. That would definitely be part of the view, not the model. That
sort of design is often done by having a parallel per-view model
that's been transformed for use in the view, and code that keeps the
per-view model synced with changes to the master. Core Animation
uses this sort of design.
Thank you, I was thinking of the bounding box as dependent on the
view. For example, I think of a "zoom" value for a view--that affects
the bounding box, doesn't it? Or do I use a sort of "natural bounding
box" for my objects that is then modified by the view's zoom?
I guess this is what you mean by "a bounding box transformed into view
coordinates". Yes, that is the way I am thinking of it, so that I can
do things like hit-testing in however many views my user might have
open. So OK I will start thinking about a parallel per-view model.
Thanks!
_______________________________________________
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