GnomeCanvas question



Hello,

I'm playing a bit with the (non-AA) canvas. At the moment I can drag items
around, and everything is fine until I want to return an item to
a certain fixed position. What I do to move 'item' to (dest_x, dest_y) is:

double xx, yy;
gnome_canvas_item_i2w(item, &xx, &yy);
gnome_canvas_item_set(item, "x", dest_x - xx, "y", dest_y - yy, NULL);

This works well, except in situations where I had dragged the item
outside the canvas. In that case, sometimes it works, and sometimes
it doesn't. When it doesn't work, the xx and yy are equal to 'nan'.

I can probably hack around this by first moving the item
with gnome_canvas_item_move back to the canvas, and then performing the
above, but I don't think this problem should arise at all.
Or am I doing something wrong?

Ronald



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