diff options
| author | gustav_b <gustav_b@users.sourceforge.net> | 2007-01-04 19:19:12 +0000 |
|---|---|---|
| committer | gustav_b <gustav_b@users.sourceforge.net> | 2007-01-04 19:19:12 +0000 |
| commit | c1d464b278f7baee612c1708414cd62693dfdf50 (patch) | |
| tree | 2677e8f51be6e6d4f257188a138bffd534a482ea /src | |
| parent | Fixed and disabled extra debugging routines in pixblock scaler and transformer (diff) | |
| download | inkscape-c1d464b278f7baee612c1708414cd62693dfdf50.tar.gz inkscape-c1d464b278f7baee612c1708414cd62693dfdf50.zip | |
Fix 1593499 (Tablet cursor drift when dragging bezier).
(bzr r2127)
Diffstat (limited to 'src')
| -rw-r--r-- | src/node-context.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/node-context.cpp b/src/node-context.cpp index 439848d52..2b30d067b 100644 --- a/src/node-context.cpp +++ b/src/node-context.cpp @@ -588,12 +588,27 @@ sp_node_context_root_handler(SPEventContext *event_context, GdkEvent *event) switch (nc->current_state) { case SP_NODE_CONTEXT_NODE_DRAGGING: { + // We round off the extra precision in the motion coordinates provided + // by some input devices (like tablets). As we'll store the coordinates + // as integers in curvepoint_event we need to do this rounding before + // comparing them with the last coordinates from curvepoint_event. + // See bug #1593499 for details. + + gint x = (gint) Inkscape::round(event->motion.x); + gint y = (gint) Inkscape::round(event->motion.y); + + // The coordinates hasn't changed since the last motion event, abort + if (nc->curvepoint_event[NR::X] == x && + nc->curvepoint_event[NR::Y] == y) + break; + NR::Point const delta_w(event->motion.x - nc->curvepoint_event[NR::X], - event->motion.y - nc->curvepoint_event[NR::Y]); + event->motion.y - nc->curvepoint_event[NR::Y]); NR::Point const delta_dt(desktop->w2d(delta_w)); + sp_nodepath_curve_drag (nc->grab_node, nc->grab_t, delta_dt); - nc->curvepoint_event[NR::X] = (gint) event->motion.x; - nc->curvepoint_event[NR::Y] = (gint) event->motion.y; + nc->curvepoint_event[NR::X] = x; + nc->curvepoint_event[NR::Y] = y; gobble_motion_events(GDK_BUTTON1_MASK); break; } |
