diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2014-01-08 10:28:46 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2014-01-08 10:28:46 -0500 |
commit | 2d283c17e17940c356af0cc1366b714e0d7b76be (patch) | |
tree | 809affc41a92fabdddd406e95bf76f533403eab0 /libs/canvas | |
parent | 33cf3413817ad4c2a8438f28c79db5fc71f672a7 (diff) |
remove unused code
Diffstat (limited to 'libs/canvas')
-rw-r--r-- | libs/canvas/canvas.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/libs/canvas/canvas.cc b/libs/canvas/canvas.cc index 313c9f7ae5..54ce92d6dd 100644 --- a/libs/canvas/canvas.cc +++ b/libs/canvas/canvas.cc @@ -195,6 +195,9 @@ 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; @@ -210,10 +213,14 @@ Rect Canvas::canvas_to_window (Rect const & r) const { Rect wr = r.translate (Duple (-_scroll_offset_x, -_scroll_offset_y)); - wr.x0 = floor (wr.x0); - wr.x1 = ceil (wr.x1); - wr.y0 = floor (wr.y0); - wr.y1 = ceil (wr.y1); + + /* 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); + return wr; } |