diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-06-24 16:28:53 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-06-24 16:28:53 -0400 |
commit | a1f858d3b207739e0719c1fc28003f1d9dd3965d (patch) | |
tree | 23c9c35f6b95e116f11354b0c78841036dcdc6bb /libs/canvas/line.cc | |
parent | 0ce393f05144762a20d72975d0254ebca0789973 (diff) |
an awful lot of tweaks to drawing details
Diffstat (limited to 'libs/canvas/line.cc')
-rw-r--r-- | libs/canvas/line.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libs/canvas/line.cc b/libs/canvas/line.cc index b6a802b8df..af2a0e47db 100644 --- a/libs/canvas/line.cc +++ b/libs/canvas/line.cc @@ -56,10 +56,15 @@ void Line::render (Rect const & /*area*/, Cairo::RefPtr<Cairo::Context> context) const { setup_outline_context (context); + Duple p0 = item_to_window (Duple (_points[0].x, _points[0].y)); Duple p1 = item_to_window (Duple (_points[1].x, _points[1].y)); - context->move_to (p0.x, p0.y); - context->line_to (p1.x, p1.y); + + /* See Cairo FAQ on single pixel lines to understand why we add 0.5 + */ + + context->move_to (p0.x + 0.5, p0.y + 0.5); + context->line_to (p1.x + 0.5, p1.y + 0.5); context->stroke (); } |