From ab105314fb7666b9637dc456fcb6a588ca9fdfb3 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 9 Feb 2017 16:27:16 +0100 Subject: [PATCH] when considering whether or not to autoscroll teh canvas, first translate allocation boundary into toplevel coordinates --- gtk2_ardour/editor_canvas.cc | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc index f847a3f707..2a6230ad8d 100644 --- a/gtk2_ardour/editor_canvas.cc +++ b/gtk2_ardour/editor_canvas.cc @@ -512,6 +512,16 @@ Editor::maybe_autoscroll (bool allow_horiz, bool allow_vert, bool from_headers) if (from_headers) { alloc = controls_layout.get_allocation (); + + int wx, wy; + + controls_layout.get_parent()->translate_coordinates (*toplevel, + alloc.get_x(), alloc.get_y(), + wx, wy); + + scrolling_boundary = ArdourCanvas::Rect (wx, wy, wx + alloc.get_width(), wy + alloc.get_height()); + + } else { alloc = _track_canvas_viewport->get_allocation (); @@ -542,9 +552,14 @@ Editor::maybe_autoscroll (bool allow_horiz, bool allow_vert, bool from_headers) alloc.set_x (alloc.get_x() + 10); } - } + int wx, wy; - scrolling_boundary = ArdourCanvas::Rect (alloc.get_x(), alloc.get_y(), alloc.get_x() + alloc.get_width(), alloc.get_y() + alloc.get_height()); + _track_canvas_viewport->get_parent()->translate_coordinates (*toplevel, + alloc.get_x(), alloc.get_y(), + wx, wy); + + scrolling_boundary = ArdourCanvas::Rect (wx, wy, wx + alloc.get_width(), wy + alloc.get_height()); + } int x, y; Gdk::ModifierType mask;