Esme Povirk (@madewokherd) commented about dlls/gdiplus/graphicspath.c:
{
tmp_points = heap_alloc_zero(custom->pathdata.Count * sizeof(GpPoint));
if (!tmp_points) {
ERR("Out of memory\n");
return;
}
for (INT i = 0; i < custom->pathdata.Count; i++)
{
tmp_points[i].X = posx + custom->pathdata.Points[i].X * cosa + (custom->pathdata.Points[i].Y - 1.0) * sina;
tmp_points[i].Y = posy + custom->pathdata.Points[i].X * sina - (custom->pathdata.Points[i].Y - 1.0) * cosa;
}
if ((custom->pathdata.Types[custom->pathdata.Count - 1] & PathPointTypeCloseSubpath) == PathPointTypeCloseSubpath)
widen_closed_figure(tmp_points, 0, custom->pathdata.Count - 1, pen, pen_width, last_point);
else
widen_open_figure(tmp_points, 0, custom->pathdata.Count - 1, pen, pen_width, LineCapFlat, LineCapFlat, last_point);
Is the duplication here OK? Seems like we'd need to recurse if the path can contain curves or multiple segments.