diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2014-11-07 12:56:45 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2014-11-07 12:58:56 -0500 |
commit | a441de1a186e5521ad448aad0b201a278e7544a4 (patch) | |
tree | 02cdefb3ea6ab21ec2e1ef996ed336a290abd0b8 /libs/canvas/rectangle.cc | |
parent | 44873d23e10cdf8446f16ba6d535510d235713d4 (diff) |
when drawing only part of a Canvas::Rectangle outline, we only need to do the cairo-pixel alignment math for the axis perpendicular to the edge
Diffstat (limited to 'libs/canvas/rectangle.cc')
-rw-r--r-- | libs/canvas/rectangle.cc | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/libs/canvas/rectangle.cc b/libs/canvas/rectangle.cc index a4540ccbac..0014958e90 100644 --- a/libs/canvas/rectangle.cc +++ b/libs/canvas/rectangle.cc @@ -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); } } |