handle enter/leave items when zooming and scrolling occur
authorPaul Davis <paul@linuxaudiosystems.com>
Thu, 31 Oct 2013 07:10:18 +0000 (03:10 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Thu, 31 Oct 2013 07:10:18 +0000 (03:10 -0400)
gtk2_ardour/editor.cc
gtk2_ardour/editor_routes.cc
libs/canvas/canvas.cc
libs/canvas/canvas/canvas.h

index 5da1d09d8f565c2248608db2e666b1aedb601b63..30463e1733d9775d1cee0207b00b86067a07b5c9 100644 (file)
@@ -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 ());
index 515ad07972d37f0643415e58461f766ce2cf31ec..673eb62e39fea8eb030021cd60de56ce02c7ef2f 100644 (file)
@@ -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
index b616e6cf591611f9e72bb77b3d69e473ed89c0cc..77a9cddd629d883378e46a5ecf6bb11e08b9f82b 100644 (file)
@@ -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.
index 05756858324fff8d9448a1d0667251c123fc9d2a..981ea05346cc6b0958446910c074e7a2d5cf60a8 100644 (file)
@@ -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;