Hi Mathieu,
Thanks for the patch. It looks OK to me (I haven't tried it yet, just read). There are two issues that I see:
1 Something's wrong with the patch file: some (all?) files are listed twice
2 I don't like having to insert desktop->namedview->reset_snapped_visual_feedback() into all contexts on mouse up. Since extra calls of this function should do no harm, I propose to do this once in event-context.cpp root handler, in case GDK_BUTTON_RELEASE unconditionally no matter which button was released (just below xp = yp = 0;). This way it will work in all tools without you having to change anything in each tool's event handlers.
Next things I could look at could be : - Snapping modes (enable/disable) Bounding box and dots snapping. I thik it could be great too temporarily disable bounding box snapping, just to make sure only dots do it.
How do you want to do that?
- Providing visual feedback of which of these is used now (you grab
a rectangle, its bounding box snaps a guide, the guide turns red (default highlight color), and a little text appears along the guide saying (snapping to boungbox). If you drag farther, the boundingbox will stop snapping and it's the corner dot that will do, so the text'll be "dot snapping" or something like this... maybe snapped dots could be highlited too
Good idea, except that please use the statusbar for such messages - it's where we display all textual hints and tips for the user.
- Making grid lines highlight when snapped, just like guides (it was
much easier for guides since they are separate objects and the color/hicolor alread existed)
Would be nice too.
- Trying to make more snapping objects... maybe angled guides,
objects themselves, middle of objects, etc... all these could be mode enabled/disabled.
Yes, you can just go through the list of SPObjects and see what meaningful way to snap them we're not using yet.
What do people think ? What feature would you like most ?
We have no shortage of snapping requests - just search our RFE tracker or this list. Personally, I think the most urgent change is to make grid snapping snap only to the visible grid lines - that is, if you zoomed out so that every 10th line is shown, snap only to those 10th lines, not to the invisible lines in between. This should take care of most of the "snapping does not work" complaints, because at most practical zooms, snapping distance is smaller than the visible distance between grid lines, and may be even smaller than a screen pixel, so people just don't realize that it's actually snapping.
-- bulia byak Inkscape. Draw Freely. http://www.inkscape.org