allow the use of static_cast for MGR ghost events (speeds things up a bit).
[ardour.git] / gtk2_ardour / editor_mouse.cc
index 3e463373d16d6767d70d15a88a5487934c450194..e34c38c43cb61291291a7bff4bcc6aa0637dce88 100644 (file)
@@ -575,8 +575,13 @@ Editor::button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType it
                if (eff_mouse_mode != MouseRange) {
                        AutomationLine* al = reinterpret_cast<AutomationLine*> (item->get_data ("line"));
                        std::list<Selectable*> selectables;
+                       double mx = event->button.x;
+                       double my = event->button.y;
+
+                       al->grab_item().canvas_to_item (mx, my);
+
                        uint32_t before, after;
-                       framecnt_t const  where = (framecnt_t) floor (event->button.x * samples_per_pixel);
+                       framecnt_t const  where = (framecnt_t) floor (mx * samples_per_pixel);
 
                        if (!al || !al->control_points_adjacent (where, before, after)) {
                                break;
@@ -2137,6 +2142,16 @@ Editor::note_edit_done (int r, EditNoteDialog* d)
        commit_reversible_command();
 }
 
+void
+Editor::edit_region (RegionView* rv)
+{
+       if (UIConfiguration::instance().get_use_double_click_to_zoom_to_selection()) {
+               temporal_zoom_selection (Both);
+       } else {
+               rv->show_region_editor ();
+       }
+}
+
 void
 Editor::visible_order_range (int* low, int* high) const
 {
@@ -2536,6 +2551,10 @@ Editor::update_join_object_range_location (double y)
 
        if (entered_regionview) {
 
+               //ToDo:  there is currently a bug here(?)
+               //when we are inside a region fade handle, it acts as though we are in range mode because it is in the top half of the region
+               //can it be fixed here?
+
                ArdourCanvas::Duple const item_space = entered_regionview->get_canvas_group()->canvas_to_item (ArdourCanvas::Duple (0, y));
                double const c = item_space.y / entered_regionview->height();