when drawing only part of a Canvas::Rectangle outline, we only need to do the cairo...
authorPaul Davis <paul@linuxaudiosystems.com>
Fri, 7 Nov 2014 17:56:45 +0000 (12:56 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Fri, 7 Nov 2014 17:58:56 +0000 (12:58 -0500)
libs/canvas/rectangle.cc

index a4540ccbacfb8bc32c7103be09ae8fe762fc239d..0014958e909344aee4735666abf2152e642cffbe 100644 (file)
@@ -104,32 +104,31 @@ Rectangle::render_self (Rect const & area, Cairo::RefPtr<Cairo::Context> context
                 * between the integer coordinates.
                 */
 
-               self = self.shrink (0.5);
-
                if (_outline_what == What (LEFT|RIGHT|BOTTOM|TOP)) {
                        
+                       self = self.shrink (0.5);
                        context->rectangle (self.x0, self.y0, self.width(), self.height());
 
                } else {
 
                        if (_outline_what & LEFT) {
-                               context->move_to (self.x0, self.y0);
-                               context->line_to (self.x0, self.y1);
+                               context->move_to (self.x0+0.5, self.y0);
+                               context->line_to (self.x0+0.5, self.y1);
                        }
                        
                        if (_outline_what & TOP) {
-                               context->move_to (self.x0, self.y0);
-                               context->line_to (self.x1, self.y0);
+                               context->move_to (self.x0, self.y0+0.5);
+                               context->line_to (self.x1, self.y0+0.5);
                        }
 
                        if (_outline_what & BOTTOM) {
-                               context->move_to (self.x0, self.y1);
-                               context->line_to (self.x1, self.y1);
+                               context->move_to (self.x0, self.y1-0.5);
+                               context->line_to (self.x1, self.y1-0.5);
                        }
                        
                        if (_outline_what & RIGHT) {
-                               context->move_to (self.x1, self.y0);
-                               context->line_to (self.x1, self.y1);
+                               context->move_to (self.x1-0.5, self.y0);
+                               context->line_to (self.x1-0.5, self.y1);
                        }
                }