summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_mouse.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2008-12-23 04:11:24 +0000
committerCarl Hetherington <carl@carlh.net>2008-12-23 04:11:24 +0000
commite6c2f03ca1200381f379da8e84f8068d2901bbaf (patch)
tree854d8d689de112bf1652b8c5ec452249cc12bc99 /gtk2_ardour/editor_mouse.cc
parentd724837a4401b3d858d2a40b388d0cca8210cd5d (diff)
Fix stacked regions display mode.
git-svn-id: svn://localhost/ardour2/branches/3.0@4337 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_mouse.cc')
-rw-r--r--gtk2_ardour/editor_mouse.cc37
1 files changed, 21 insertions, 16 deletions
diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc
index b652d129f6..c3a9bce7a8 100644
--- a/gtk2_ardour/editor_mouse.cc
+++ b/gtk2_ardour/editor_mouse.cc
@@ -1,4 +1,3 @@
-
/*
Copyright (C) 2000-2001 Paul Davis
@@ -3902,7 +3901,7 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
double ix1, ix2, iy1, iy2;
rv2->get_canvas_frame()->get_bounds (ix1, iy1, ix2, iy2);
rv2->get_canvas_frame()->i2w (ix1, iy1);
-
+
if (-x_delta > ix1 + horizontal_adjustment.get_value()) {
// do_move = false;
x_delta = 0;
@@ -3954,27 +3953,33 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
for (list<RegionView*>::const_iterator i = layered_regions.begin(); i != layered_regions.end(); ++i) {
RegionView* rv = (*i);
- double ix1, ix2, iy1, iy2;
int32_t temp_pointer_y_span = pointer_y_span;
if (rv->region()->locked()) {
continue;
}
- /* get item BBox, which will be relative to parent. so we have
- to query on a child, then convert to world coordinates using
- the parent.
- */
+ /* here we are calculating the y distance from the
+ top of the first track view to the top of the region
+ area of the track view that we're working on */
- rv->get_canvas_frame()->get_bounds (ix1, iy1, ix2, iy2);
- rv->get_canvas_frame()->i2w (ix1, iy1);
+ /* this x value is just a dummy value so that we have something
+ to pass to i2w () */
+
+ double ix1 = 0;
+
+ /* distance from the top of this track view to the region area
+ of our track view is always 1 */
+
+ double iy1 = 1;
+
+ /* convert to world coordinates, ie distance from the top of
+ the ruler section */
- cerr << "adjust y from " << iy1 << " using "
- << vertical_adjustment.get_value() << " - "
- << canvas_timebars_vsize
- << endl;
+ rv->get_canvas_frame()->i2w (ix1, iy1);
- iy1 += get_trackview_group_vertical_offset ();;
+ /* compensate for the ruler section and the vertical scrollbar position */
+ iy1 += get_trackview_group_vertical_offset ();
if (drag_info.first_move) {
@@ -3989,7 +3994,7 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
parent groups have different coordinates.
*/
- rv->get_canvas_group()->property_y() = iy1 - 1;
+ rv->get_canvas_group()->property_y() = iy1 - 1;
rv->get_canvas_group()->reparent(*_region_motion_group);
rv->fake_set_opaque (true);
@@ -4040,7 +4045,7 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
temp_pointer_y_span++;
}
/* find out where we'll be when we move and set height accordingly */
-
+
tvp2 = trackview_by_y_position (iy1 + y_delta);
temp_rtv = dynamic_cast<RouteTimeAxisView*>(tvp2);
rv->set_height (temp_rtv->current_height());