From 7ce86cec7d70cbec1412e168f71b1f4e8718fabc Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 31 Oct 2013 03:10:18 -0400 Subject: [PATCH] handle enter/leave items when zooming and scrolling occur --- gtk2_ardour/editor.cc | 11 ++++++++++- gtk2_ardour/editor_routes.cc | 6 ------ libs/canvas/canvas.cc | 8 ++++++++ libs/canvas/canvas/canvas.h | 2 ++ 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 5da1d09d8f..30463e1733 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -4269,7 +4269,16 @@ Editor::set_samples_per_pixel (framecnt_t spp) ZoomChanged (); /* EMIT_SIGNAL */ - //reset_scrolling_region (); + ArdourCanvas::GtkCanvasViewport* c; + + c = get_time_bars_canvas(); + if (c) { + c->canvas()->zoomed (); + } + c = get_track_canvas(); + if (c) { + c->canvas()->zoomed (); + } if (playhead_cursor) { playhead_cursor->set_position (playhead_cursor->current_frame ()); diff --git a/gtk2_ardour/editor_routes.cc b/gtk2_ardour/editor_routes.cc index 515ad07972..673eb62e39 100644 --- a/gtk2_ardour/editor_routes.cc +++ b/gtk2_ardour/editor_routes.cc @@ -1004,12 +1004,6 @@ EditorRoutes::hide_all_tracks (bool /*with_select*/) } resume_redisplay (); - - /* XXX this seems like a hack and half, but its not clear where to put this - otherwise. - */ - - //reset_scrolling_region (); } void diff --git a/libs/canvas/canvas.cc b/libs/canvas/canvas.cc index b616e6cf59..77a9cddd62 100644 --- a/libs/canvas/canvas.cc +++ b/libs/canvas/canvas.cc @@ -49,6 +49,14 @@ Canvas::scroll_to (Coord x, Coord y) { _scroll_offset_x = x; _scroll_offset_y = y; + + enter_leave_items (0); // no current mouse position +} + +void +Canvas::zoomed () +{ + enter_leave_items (0); // no current mouse position } /** Render an area of the canvas. diff --git a/libs/canvas/canvas/canvas.h b/libs/canvas/canvas/canvas.h index 0575685832..981ea05346 100644 --- a/libs/canvas/canvas/canvas.h +++ b/libs/canvas/canvas/canvas.h @@ -107,6 +107,8 @@ public: void scroll_to (Coord x, Coord y); virtual Rect visible_area () const = 0; + void zoomed(); + std::string indent() const; std::string render_indent() const; void dump (std::ostream&) const; -- 2.30.2