diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2014-02-25 11:35:00 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2014-02-25 12:02:50 -0500 |
commit | 737aae908af36ef6b4bd7592c514d2fa48638525 (patch) | |
tree | 95225a7cc7d5c1563090432ae4ec87f1c739be34 /libs/canvas/rectangle.cc | |
parent | d81caf0680eb30c0055b8f018b952c0d77fe2ef9 (diff) |
tweak canvas rect drawing to correctly place bottom edge of rectangle inside the bounds (cairo works in mysterious ways)
Diffstat (limited to 'libs/canvas/rectangle.cc')
-rw-r--r-- | libs/canvas/rectangle.cc | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/libs/canvas/rectangle.cc b/libs/canvas/rectangle.cc index 57aa92d040..acda1708a3 100644 --- a/libs/canvas/rectangle.cc +++ b/libs/canvas/rectangle.cc @@ -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) { |