Re: NSView and array of moveable NSImages
Re: NSView and array of moveable NSImages
- Subject: Re: NSView and array of moveable NSImages
- From: "Fen Soares" <email@hidden>
- Date: Fri, 6 Apr 2007 09:10:00 +0100
On 05/04/07, I. Savant <email@hidden> wrote:
On 4/5/07, Scott Anguish <email@hidden> wrote:
> Actually, I used a double linked list, since this made it easy to
> traverse into groups, and move items around wholesale. But this was
> a large, large scale package that often had 50,000 items to deal with.
I've done very little drawing of this nature (with mutable z-order),
so this is as enlightening to me as I'm sure it is to Fen. Thanks for
the insight!
--
I.S.
Great stuff guys!
The quickest implementation was just to insert new items into my mutable
array at index 0 and let them stack up that way. A simple 'reverse
enumeration' displays them hierarchically with 0 appearing ontop, and then
the intersection test is a simple 'forward enumeration' and break on
intersection with whatever we hit first in the array that overlaps. This
retains the logic of 0-zindex being topmost.
It's good enough for now, but Scott's suggestion is definitely a good'un for
future ref.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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