diff options
author | Carl Hetherington <carl@carlh.net> | 2011-11-22 12:22:46 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2011-11-22 12:22:46 +0000 |
commit | b78cb4d41aa59311e46ca9d9101c1b5f6107e415 (patch) | |
tree | a6564743bfea68e1e2011e5f2e2bfdf4ab6be1cd /gtk2_ardour/editor_canvas.cc | |
parent | 8016c4dec0f31fa8c4212f53f467a0bf15502afc (diff) |
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
Diffstat (limited to 'gtk2_ardour/editor_canvas.cc')
-rw-r--r-- | gtk2_ardour/editor_canvas.cc | 19 |
1 files 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> gdk_window = get_window (); - Gdk::Rectangle window_rect; - gdk_window->get_frame_extents (window_rect); - - Glib::RefPtr<Gdk::Screen> 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) { |