diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2014-06-03 15:57:56 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2014-06-03 16:13:12 -0400 |
commit | e0533e9dd7df504236892fe0d8693e7ad9a6a278 (patch) | |
tree | 43d6f88e7d8cec6acf9db9965ec6536f2349a1c0 /gtk2_ardour/region_view.cc | |
parent | d4989ed9cedcfbff48f6131c595691005283a435 (diff) |
more profound changes to canvas scrolling, in particular find appropriate ScrollGroup for Canvas::{window,canvas}_to_{canvas,window}()
Diffstat (limited to 'gtk2_ardour/region_view.cc')
-rw-r--r-- | gtk2_ardour/region_view.cc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/gtk2_ardour/region_view.cc b/gtk2_ardour/region_view.cc index 127ce79b84..dfdf0651f6 100644 --- a/gtk2_ardour/region_view.cc +++ b/gtk2_ardour/region_view.cc @@ -694,7 +694,18 @@ RegionView::move (double x_delta, double y_delta) return; } - get_canvas_group()->move (ArdourCanvas::Duple (x_delta, y_delta)); + /* items will not prevent Item::move() moving + * them to a negative x-axis coordinate, which + * is legal, but we don't want that here. + */ + + ArdourCanvas::Item *item = get_canvas_group (); + + if (item->position().x + x_delta < 0) { + x_delta = -item->position().x; /* move it to zero */ + } + + item->move (ArdourCanvas::Duple (x_delta, y_delta)); /* note: ghosts never leave their tracks so y_delta for them is always zero */ |