Re: canvas item collisions



Federico Mena Quintero wrote:
> 
> Oh, so you are doing some sort of DnD across items?

Yes.  My project (Loci) is akin to Gnogurt, where icons are connected via
lines.  Each icon has a number of lines, and you connect icons by dragging the
end of one line on top of the end of another.

> Hiding the item you are dragging and doing hit testing on the items
> below somehow sounds horribly hackish, but as it doesn't flicker, I
> guess it is OK :-)

Actually, I only do the check on one point (the very tip of the line) when the
line is dropped (mouse button 1 release).  So there is no problem with
flickering.  However, I do have large dots (ellipse items) at the end of
lines, and it would be nice if I could tell what was under every pixel of the
dot, without doing get_item_at's for the whole area of a circle.  But checking
_one_ point is acceptable for now.

> I think we need a better API for hit testing, maybe passing an "ignore
> list" of items to gnome_canvas_get_item_at().

Something that could probe the entire area under the item anyway.


Thanks!
Jeff



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]