fix dragging playhead using time rulers
authorRobin Gareus <robin@gareus.org>
Sat, 4 Jan 2014 15:28:00 +0000 (16:28 +0100)
committerRobin Gareus <robin@gareus.org>
Sat, 4 Jan 2014 15:28:00 +0000 (16:28 +0100)
gtk2_ardour/editor_rulers.cc

index 27a13a94b760a8e29037d9546526fcb3083a8a77..865a555c8a2a4b10557449be834f0ac9bf579d00 100644 (file)
@@ -324,7 +324,11 @@ Editor::ruler_mouse_motion (GdkEventMotion* ev)
        }
 
        if (_drags->active ()) {
-               _drags->window_motion_handler (reinterpret_cast<GdkEvent*> (ev), false);
+               GdkEventMotion canvas_ev = *ev;
+               ArdourCanvas::Duple d = _track_canvas->window_to_canvas (ArdourCanvas::Duple (ev->x, ev->y));
+               canvas_ev.x = rint (d.x);
+               canvas_ev.y = rint (d.y);
+               _drags->window_motion_handler (reinterpret_cast<GdkEvent*> (&canvas_ev), false);
        }
 
        return true;