Revert "remove unused code"
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 8 Jan 2014 15:29:03 +0000 (10:29 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 8 Jan 2014 15:29:03 +0000 (10:29 -0500)
This reverts commit 2d283c17e17940c356af0cc1366b714e0d7b76be.

libs/canvas/canvas.cc

index 54ce92d6ddfac6be2ba18d5de5d3d20fae148b30..313c9f7ae5f3e226508e44f570b776c4d630e73a 100644 (file)
@@ -195,9 +195,6 @@ Duple
 Canvas::canvas_to_window (Duple const & d) const
 {
        Duple wd = d.translate (Duple (-_scroll_offset_x, -_scroll_offset_y));
-
-       /* Notice that this always return integer (pixel) values. */
-
        wd.x = round (wd.x);
        wd.y = round (wd.y);
        return wd;
@@ -213,14 +210,10 @@ Rect
 Canvas::canvas_to_window (Rect const & r) const
 {
        Rect wr = r.translate (Duple (-_scroll_offset_x, -_scroll_offset_y));
-
-       /* Notice that this always return integer (pixel) values. */
-
-       wr.x0 = round (wr.x0);
-       wr.x1 = round (wr.x1);
-       wr.y0 = round (wr.y0);
-       wr.y1 = round (wr.y1);
-
+       wr.x0 = floor (wr.x0);
+       wr.x1 = ceil (wr.x1);
+       wr.y0 = floor (wr.y0);
+       wr.y1 = ceil (wr.y1);
        return wr;
 }