X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fcanvas%2Fline.cc;h=09f9061c8593653b601c3d6791c7c42918f06982;hb=fee026c5ef7107d5d594159f5ece5917041591f7;hp=61acf892528a0d73c150008c400d63f2cef75c6a;hpb=1745340c67d66d8dd92e5b3a377e935ed5eea973;p=ardour.git diff --git a/libs/canvas/line.cc b/libs/canvas/line.cc index 61acf89252..09f9061c85 100644 --- a/libs/canvas/line.cc +++ b/libs/canvas/line.cc @@ -60,11 +60,17 @@ Line::render (Rect const & /*area*/, Cairo::RefPtr context) cons Duple p0 = item_to_window (Duple (_points[0].x, _points[0].y)); Duple p1 = item_to_window (Duple (_points[1].x, _points[1].y)); - /* See Cairo FAQ on single pixel lines to understand why we add 0.5 - */ + if (_outline_width <= 1.0) { + /* See Cairo FAQ on single pixel lines to understand why we add 0.5 + */ + + const Duple half_a_pixel (0.5, 0.5); + p0 = p0.translate (half_a_pixel); + p1 = p1.translate (half_a_pixel); + } - context->move_to (p0.x + 0.5, p0.y + 0.5); - context->line_to (p1.x + 0.5, p1.y + 0.5); + context->move_to (p0.x, p0.y); + context->line_to (p1.x, p1.y); context->stroke (); }