Commit 6ec3cd94 authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

gdiplus: Set flatness more appropriately in GdipDrawPath.

If the path is going to be scaled before rendering, 1.0 does not make sense as an error value. Signed-off-by: 's avatarVincent Povirk <vincent@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 2eeef78e
......@@ -3715,6 +3715,7 @@ static GpStatus SOFTWARE_GdipDrawPath(GpGraphics *graphics, GpPen *pen, GpPath *
GpStatus stat;
GpPath *wide_path;
GpMatrix *transform=NULL;
REAL flatness=1.0;
/* Check if the final pen thickness in pixels is too thin. */
if (pen->unit == UnitPixel)
......@@ -3756,9 +3757,24 @@ static GpStatus SOFTWARE_GdipDrawPath(GpGraphics *graphics, GpPen *pen, GpPath *
stat = get_graphics_transform(graphics, CoordinateSpaceDevice,
CoordinateSpaceWorld, transform);
}
else
{
/* Set flatness based on the final coordinate space */
GpMatrix t;
stat = get_graphics_transform(graphics, CoordinateSpaceDevice,
CoordinateSpaceWorld, &t);
if (stat != Ok)
return stat;
flatness = 1.0/sqrt(fmax(
t.matrix[0] * t.matrix[0] + t.matrix[1] * t.matrix[1],
t.matrix[2] * t.matrix[2] + t.matrix[3] * t.matrix[3]));
}
if (stat == Ok)
stat = GdipWidenPath(wide_path, pen, transform, 1.0);
stat = GdipWidenPath(wide_path, pen, transform, flatness);
if (pen->unit == UnitPixel)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment