diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-04-12 11:09:49 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-04-12 11:09:49 -0400 |
commit | ecfd2a74552a45781e4d57a09e73313cd8815a4d (patch) | |
tree | fbd236dd6b63074b8bebe4aa6eb0b129236bff7a /gtk2_ardour/editor_canvas_events.cc | |
parent | fcb423f3f69225e0be896cb10b34b9628ab666f2 (diff) |
remove all unit-based methods from (Public)Editor; rationalize Editor::event_frame() to clearly identify whether the passed-in GdkEvent has window units or canvas units (the latter will be true for all events that are handled by the canvas and then passed to Editor
Diffstat (limited to 'gtk2_ardour/editor_canvas_events.cc')
-rw-r--r-- | gtk2_ardour/editor_canvas_events.cc | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/gtk2_ardour/editor_canvas_events.cc b/gtk2_ardour/editor_canvas_events.cc index afbfff2248..0c55da8a0a 100644 --- a/gtk2_ardour/editor_canvas_events.cc +++ b/gtk2_ardour/editor_canvas_events.cc @@ -1003,8 +1003,6 @@ Editor::canvas_note_event (GdkEvent *event, ArdourCanvas::Item* item) bool Editor::track_canvas_drag_motion (Glib::RefPtr<Gdk::DragContext> const& context, int x, int y, guint time) { - ArdourCanvas::Coord wx; - ArdourCanvas::Coord wy; boost::shared_ptr<Region> region; boost::shared_ptr<Region> region_copy; RouteTimeAxisView* rtav; @@ -1018,15 +1016,13 @@ Editor::track_canvas_drag_motion (Glib::RefPtr<Gdk::DragContext> const& context, return false; } - _track_canvas_viewport->window_to_canvas (x, y, wx, wy); - event.type = GDK_MOTION_NOTIFY; - event.button.x = wx; - event.button.y = wy; + event.button.x = x; + event.button.y = y; /* assume we're dragging with button 1 */ event.motion.state = Gdk::BUTTON1_MASK; - (void) event_frame (&event, &px, &py); + (void) window_event_frame (&event, &px, &py); std::pair<TimeAxisView*, int> const tv = trackview_by_y_position (py); bool can_drop = false; @@ -1096,8 +1092,6 @@ Editor::drop_regions (const Glib::RefPtr<Gdk::DragContext>& /*context*/, const SelectionData& /*data*/, guint /*info*/, guint /*time*/) { - double wx; - double wy; boost::shared_ptr<Region> region; boost::shared_ptr<Region> region_copy; RouteTimeAxisView* rtav; @@ -1105,15 +1099,13 @@ Editor::drop_regions (const Glib::RefPtr<Gdk::DragContext>& /*context*/, double px; double py; - _track_canvas_viewport->window_to_canvas (x, y, wx, wy); - event.type = GDK_MOTION_NOTIFY; - event.button.x = wx; - event.button.y = wy; + event.button.x = x; + event.button.y = y; /* assume we're dragging with button 1 */ event.motion.state = Gdk::BUTTON1_MASK; - framepos_t const pos = event_frame (&event, &px, &py); + framepos_t const pos = window_event_frame (&event, &px, &py); std::pair<TimeAxisView*, int> const tv = trackview_by_y_position (py); |