a couple of debug output statements to help diagnose a crash
[ardour.git] / libs / canvas / scroll_group.cc
index 1562643b4a936a031196d090b65a8146c6601967..3feb37f83a2ccd593ed74b2d0bbec9ef63b7dad3 100644 (file)
@@ -84,13 +84,18 @@ ScrollGroup::scroll_to (Duple const& d)
 bool
 ScrollGroup::covers_canvas (Duple const& d) const
 {
-       boost::optional<Rect> r = bounding_box ();
+        boost::optional<Rect> r = bounding_box ();
 
        if (!r) {
                return false;
        }
 
-       return r->contains (d);
+        /* Bounding box is in item coordinates, but we need
+           to consider the position of the bounding box
+           within the canvas.
+        */
+        
+       return r->translate (position()).contains (d);
 }
 
 bool
@@ -102,7 +107,10 @@ ScrollGroup::covers_window (Duple const& d) const
                return false;
        }
 
-       Rect w = r->translate (-_scroll_offset);
-
-       return w.contains (d);
+        /* Bounding box is in item coordinates, but we need
+           to consider the position of the bounding box
+           within the canvas. 
+        */
+        
+       return r->translate (position()).contains (d);
 }