when drawing a line, we check if the line is only one point, to even draw a line

this fixes bug #709, but it's not quite good in my opinion (Stephan, please could you review?)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18050 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval 2006-07-06 18:58:47 +00:00
parent 77f879871f
commit c8bb68e11b
1 changed files with 15 additions and 5 deletions

View File

@ -342,12 +342,22 @@ Painter::StrokeLine(BPoint a, BPoint b)
return _Clipped(touched);
}
}
// do the pixel center offset here
a.x += 0.5;
a.y += 0.5;
b.x += 0.5;
b.y += 0.5;
// 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;
}
agg::path_storage path;
path.move_to(a.x, a.y);
path.line_to(b.x, b.y);