Hay! It was me. I thought you've forgotten that one. Aside from technical details, which are not common to me, this improvement will be noticeable even more as our renderer start to gain some more speed.
Building now... Built.
Some thoughts: 1) If "Always snap" is on, turn off detection of motion speed. 2) Wait a few milliseconds when snapping occurs to avoid re-snapping glitches 3) Works fine with wacom graphire3 tablet :)
Vlada
Diederik van Lierop wrote:
Hi,
Way back in time, someone suggested that snapping should only occur at the end of a movement or only at low mouse-speeds, as this would make Inkscape more responsive. I finally got to implementing this and apparently it works nicely, but I think it could use some testing on other systems, for example by users with a tablet. Let me first shortly explain what I implemented:
Inkscape now has a hard-coded speed limit above which no snapping will occur. The speed is calculated after each GDK_MOTION_NOTIFY event (in sp_canvas_motion). When trying to stop my mouse movements as fast as possible I measured speeds up to 1 pixel per millisecond at the last event in line. The speed limit should be above this value, otherwise snapping might not occur when breaking hard. When moving slowly though, almost all motion events will cause snapping when we use such a high speed limit, which wouldn't help in making Inkscape more responsive. I solved this by using both a watchdog timer and a relatively low speed-limit of 0.1 px/msec. The watchdog ensures that Inkscape will always snap at the end of a movement, even when we break abruptly. It will bark when no event comes in below the speed limit, within 100 msec after the last event. In such a case the last event will be repeated with snapping enabled.
There might be some issues though:
- Is it good practice to resend an event? Or might this have side
effects of which I'm not aware? 2) Someone mentioned in another thread that tablets will show jitter or noise. If the noise-level of the measured speed is above our speed limit, then Inkscape will not snap predictably. Could someone with a tablet (or a more expensive mouse) please uncomment line 1615 in sp-canvas.cpp and report to me what speed is measured? 3) When moving at speeds around the speed limit, Inkscape might snap for one motion event but not for the next, which will make the object that's being dragged jump from the snapped position to the mouse position and back again. That could be annoying, but I don't see an easy way around this.
Any comment is appreciated!
Diederik