On 10/26/2008 07:47 PM, Vladimir Savic wrote:
Careful choice of snapping time delay will _probably_ make jitter much less present.
I've changed the snapping behavior in my latest commit, once again. Inkscape now always postpones snapping until the mouse movement has settled, and after that waits for and additional 400 msec. It will now snap only once, at the end of the movement. We still have the speed threshold to eliminate any tablet jitter, but it's at 0.02 px/msec. And if we happen to have any jitter then Inkscape will snap never more than 2.5 times per second. I really like this already, because now the snapping is very predictable and no processing power is wasted at all. Please test this and tell me if you like it too!
Another thing that I've added is that when finding the node with the best snap, we now also consider the initial distance to the mouse pointer, not just the distance to the snapped point. This way you can indicate which node you would like to snap by grabbing the selected item at that specific node. I've used a weight factor for this, which you can adjust on line 80 of snapped-point.cpp (for those who want to play with this):
double const w = 0.25; // weigth factor: controls which node should be preferrerd for snapping, which is either // the node with the closest snap (w = 0), or the node closest to the mousepointer (w = 1)
When set to 0, it won't always work as expected. I still have to look into this. Maybe we can provide a slider in the UI one day to adjust this weight factor dynamically, if we're going this route.
Regards,
Diederik