From b78cb4d41aa59311e46ca9d9101c1b5f6107e415 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 22 Nov 2011 12:22:46 +0000 Subject: [PATCH] Fix autoscroll fudge calculations. Remove some unused code. Should help with #4501. git-svn-id: svn://localhost/ardour2/branches/3.0@10767 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor_canvas.cc | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc index ddbb1f0a12..479784ad14 100644 --- a/gtk2_ardour/editor_canvas.cc +++ b/gtk2_ardour/editor_canvas.cc @@ -509,9 +509,9 @@ Editor::maybe_autoscroll (bool allow_horiz, bool allow_vert) Gtk::Allocation editor_list = _the_notebook.get_allocation (); - int distance = root_rect.get_x() + root_rect.get_width() - window_rect.get_x() - window_rect.get_width(); + framecnt_t distance = pixel_to_frame (root_rect.get_x() + root_rect.get_width() - window_rect.get_x() - window_rect.get_width()); if (_the_notebook.is_visible ()) { - distance += editor_list.get_width(); + distance += pixel_to_frame (editor_list.get_width()); } /* Note whether we're fudging the autoscroll (see autoscroll_fudge_threshold) */ @@ -572,21 +572,6 @@ Editor::autoscroll_canvas () GdkEventMotion ev; double new_pixel; double target_pixel; - - /* Work out whether the right-hand side of this window is next to the edge of the screen */ - - Glib::RefPtr gdk_window = get_window (); - Gdk::Rectangle window_rect; - gdk_window->get_frame_extents (window_rect); - - Glib::RefPtr screen = get_screen (); - Gdk::Rectangle root_rect; - screen->get_root_window()->get_frame_extents (root_rect); - - int distance = root_rect.get_x() + root_rect.get_width() - window_rect.get_x() - window_rect.get_width(); - if (_the_notebook.is_visible ()) { - distance += _the_notebook.get_allocation().get_width(); - } if (autoscroll_x_distance != 0) {