Make object/range link work with stacked region mode. Fixes #3468.
authorCarl Hetherington <carl@carlh.net>
Tue, 21 Sep 2010 23:26:18 +0000 (23:26 +0000)
committerCarl Hetherington <carl@carlh.net>
Tue, 21 Sep 2010 23:26:18 +0000 (23:26 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@7826 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/editor_mouse.cc

index 8adefaaa62ab55c105bcb44d528eabb47b615f24..45e71e705859e9a975bf3469b08cf70096b72d3c 100644 (file)
@@ -2773,9 +2773,11 @@ Editor::update_join_object_range_location (double x, double y)
                        double cy = y;
                        rtv->canvas_display()->w2i (cx, cy);
 
-                       bool const top_half = cy < rtv->current_height () / 2;
-                       
-                       _join_object_range_state = top_half ? JOIN_OBJECT_RANGE_RANGE : JOIN_OBJECT_RANGE_OBJECT;
+                       double const c = cy / rtv->view()->child_height();
+                       double d;
+                       double const f = modf (c, &d);
+
+                       _join_object_range_state = f < 0.5 ? JOIN_OBJECT_RANGE_RANGE : JOIN_OBJECT_RANGE_OBJECT;
                }
        }
 }