[Drawkit] Keeping objects sorted

James Maxwell jbmaxwell at rubato-music.com
Thu Jul 3 11:06:10 PDT 2008


Hi All,

In my particular app, it would be really helpful if I could keep drawn  
objects sorted by x position.
Does anyone know a simple and straightforward way of doing that? For  
example, I want my vertical guides to always be sorted by -position:,  
so I can efficiently get the closest guide "before" or "after" a  
particular object (this is a music app, so time runs left to right). I  
also want to do this with my main drawing layer's objects - keeping  
them ordered by x position (i.e., time). Is there no simple way to  
sort an array, like m_vGuides, for example, "in-place", without making  
a new sorted array and assigning it?

J.


More information about the Drawkit mailing list