From e0533e9dd7df504236892fe0d8693e7ad9a6a278 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 3 Jun 2014 15:57:56 -0400 Subject: more profound changes to canvas scrolling, in particular find appropriate ScrollGroup for Canvas::{window,canvas}_to_{canvas,window}() --- gtk2_ardour/region_view.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'gtk2_ardour/region_view.cc') 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 */ -- cgit v1.2.3