Fix 0006183 (waveview crash).
[ardour.git] / libs / canvas / item.cc
index 3ec06130b7c163ee020e79ab67ccc4a31bf9493a..ab8764a97a9677ad5ac138d4d85c27e054b83bb3 100644 (file)
@@ -231,14 +231,16 @@ Item::window_to_item (ArdourCanvas::Duple const & d) const
 }
 
 ArdourCanvas::Rect
-Item::item_to_window (ArdourCanvas::Rect const & r) const
+Item::item_to_window (ArdourCanvas::Rect const & r, bool rounded) const
 {
        Rect ret = item_to_canvas (r).translate (-scroll_offset());
 
-       ret.x0 = round (ret.x0);
-       ret.x1 = round (ret.x1);
-       ret.y0 = round (ret.y0);
-       ret.y1 = round (ret.y1);
+       if (rounded) {
+               ret.x0 = round (ret.x0);
+               ret.x1 = round (ret.x1);
+               ret.y0 = round (ret.y0);
+               ret.y1 = round (ret.y1);
+       }
 
        return ret;
 }
@@ -594,7 +596,7 @@ Item::height () const
 Coord
 Item::width () const 
 {
-       boost::optional<ArdourCanvas::Rect> bb = bounding_box().get();
+       boost::optional<ArdourCanvas::Rect> bb = bounding_box();
 
        if (bb) {
                return bb->width ();
@@ -766,7 +768,7 @@ Item::render_children (Rect const & area, Cairo::RefPtr<Cairo::Context> context)
                        continue;
                }
                
-               Rect item = (*i)->item_to_window (item_bbox.get());
+               Rect item = (*i)->item_to_window (item_bbox.get(), false);
                boost::optional<Rect> d = item.intersection (area);
                
                if (d) {