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:
@@ -342,12 +342,22 @@ Painter::StrokeLine(BPoint a, BPoint b)
|
|||||||
return _Clipped(touched);
|
return _Clipped(touched);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// do the pixel center offset here
|
// do the pixel center offset here
|
||||||
a.x += 0.5;
|
// TODO review this :
|
||||||
a.y += 0.5;
|
// in case it's the same pixel, we offset differently to have something drawn
|
||||||
b.x += 0.5;
|
if (a == b) {
|
||||||
b.y += 0.5;
|
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;
|
agg::path_storage path;
|
||||||
path.move_to(a.x, a.y);
|
path.move_to(a.x, a.y);
|
||||||
path.line_to(b.x, b.y);
|
path.line_to(b.x, b.y);
|
||||||
|
|||||||
Reference in New Issue
Block a user