From ae540011ed07985a476600b9d96ff587684d6fa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Thu, 14 Sep 2006 18:00:09 +0000 Subject: [PATCH] * when the layout branch was merged, the same problem got fixed twice, any unoptimized lines were drawn at a (0.5, 0.5) offset git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18841 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/drawing/Painter/Painter.cpp | 25 +++++---------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/src/servers/app/drawing/Painter/Painter.cpp b/src/servers/app/drawing/Painter/Painter.cpp index a5275e8991..5603653d80 100644 --- a/src/servers/app/drawing/Painter/Painter.cpp +++ b/src/servers/app/drawing/Painter/Painter.cpp @@ -352,21 +352,6 @@ Painter::StrokeLine(BPoint a, BPoint b) } } - // do the pixel center offset here - // TODO review this : - // in case it's the same pixel, we offset differently to have something drawn - if (a == b) { - a.x += 0.25; - a.y += 0.25; - b.x += 0.75; - b.y += 0.75; - } else { - a.x += 0.5; - a.y += 0.5; - b.x += 0.5; - b.y += 0.5; - } - fPath.remove_all(); if (a == b) { @@ -379,10 +364,12 @@ Painter::StrokeLine(BPoint a, BPoint b) touched = _FillPath(fPath); } else { // do the pixel center offset here - a.x += 0.5; - a.y += 0.5; - b.x += 0.5; - b.y += 0.5; + if (!fSubpixelPrecise && fmodf(fPenSize, 2.0) != 0.0) { + a.x += 0.5; + a.y += 0.5; + b.x += 0.5; + b.y += 0.5; + } fPath.move_to(a.x, a.y); fPath.line_to(b.x, b.y);