tweak canvas rect drawing to correctly place bottom edge of rectangle inside the...
authorPaul Davis <paul@linuxaudiosystems.com>
Tue, 25 Feb 2014 16:35:00 +0000 (11:35 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 25 Feb 2014 17:02:50 +0000 (12:02 -0500)
libs/canvas/rectangle.cc

index 57aa92d040ae2b6b3bd6825613252430c9104f22..acda1708a3f425799d5b2a894894005e5f6edd40 100644 (file)
@@ -97,16 +97,10 @@ Rectangle::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) con
                                context->line_to (self.x1, self.y0 + 0.5);
                        }
 
-                       /* in theory, you'd expect us to adjust these two by
-                        * MINUS 0.5 pixels. But the way that Cairo apparently
-                        * does rounding can lead that approach to draw on the
-                        * wrong pixel coordinate. So we add 0.5 even here.
-                        */
-
                        if (_outline_what & BOTTOM) {
                                /* horizontal line: move y-coordinate by 0.5 pixels */
-                               context->move_to (self.x0, self.y1 + 0.5);
-                               context->line_to (self.x1, self.y1 + 0.5);
+                               context->move_to (self.x0, self.y1 - 0.5);
+                               context->line_to (self.x1, self.y1 - 0.5);
                        }
                        
                        if (_outline_what & RIGHT) {