Gabbed item of a selection
Hi,
How can I get the the grabbed item of a selection when this selection is moved with the mouse ? I took a look to see if there was a Selection::GabbedItem() method but I'm not able to find a such thing
Yann Papouin-3 wrote:
I took a look to see if there was a Selection::GabbedItem() method but I'm not able to find a such thing
There is no such concept at all, and I'm not really sure why you need this. Look at sp_event_context_find_item instead which will give you the item under a given point, but it would be better if you explained what you're trying to do.
Regards, Krzysztof Kosiński
Thank you, I will try this.
I'm trying to learn the way Inkscape works, and in this case I will try to modify the bounding box snap code for a selection.
Actually the bounding box for snapping is computed from all the current selection but in my case it will be smarter if it only use the bounding box of the main item of a selection (and now I know how to get this) when multiple items are selected. And to return to the way it works actually, I will just have to group the current selection I think to have a single object.
So I will try to change this and see consequences on an every day work.
Yann. 2009/7/26 Krzysztof Kosiński tweenk.pl@...400...
There is no such concept at all, and I'm not really sure why you need this. Look at sp_event_context_find_item instead which will give you the item under a given point, but it would be better if you explained what you're trying to do.
Regards, Krzysztof Kosiński
On 07/26/2009 01:15 PM, Yann Papouin wrote:
Actually the bounding box for snapping is computed from all the current selection but in my case it will be smarter if it only use the bounding box of the main item of a selection
Why would that be smarter? Do you want to snap the bounding box of only the item that's under the mouse pointer, instead of the bounding box of each item in the selection?
Diederik
2009/7/26 Diederik van Lierop <mail@...1689...>
Why would that be smarter? Do you want to snap the bounding box of only the item that's under the mouse pointer, instead of the bounding box of each item in the selection?
Take a look on http://ftpmerou.free.fr/inkscape/snap-bounding-box-selection.png to see what I mean. I just want to snap to the middle bounding box of the "middle man" not the bounding box of all the selection. In the case I want to snap to all the selection, I will group it.
So, I made it :) I wrote a bug report for it: https://bugs.launchpad.net/inkscape/+bug/404941
Yann Papouin-3 wrote:
Actually the bounding box for snapping is computed from all the current selection but in my case it will be smarter if it only use the bounding box of the main item of a selection (and now I know how to get this) when multiple items are selected.
I think the already existing option of "Only snap the node closest to pointer" in Inkscape Preferences->Snapping might be more intuitive. It could be made a per-document setting like the rest of snapping options though.
Regards, Krzysztof Kosiński
participants (3)
-
Diederik van Lierop
-
Krzysztof Kosiński
-
Yann Papouin