Commit c5ae9029 authored by Jeff Smith's avatar Jeff Smith Committed by Alexandre Julliard

gdiplus: Reuse point when calling GdipAddPathLine2 on open figure.

parent f54bf06a
......@@ -637,32 +637,12 @@ GpStatus WINGDIPAPI GdipAddPathEllipseI(GpPath *path, INT x, INT y, INT width,
GpStatus WINGDIPAPI GdipAddPathLine2(GpPath *path, GDIPCONST GpPointF *points,
INT count)
{
INT i, old_count;
TRACE("(%p, %p, %d)\n", path, points, count);
if(!path || !points || count < 1)
return InvalidParameter;
if(!lengthen_path(path, count))
return OutOfMemory;
old_count = path->pathdata.Count;
for(i = 0; i < count; i++){
path->pathdata.Points[old_count + i].X = points[i].X;
path->pathdata.Points[old_count + i].Y = points[i].Y;
path->pathdata.Types[old_count + i] = PathPointTypeLine;
}
if(path->newfigure){
path->pathdata.Types[old_count] = PathPointTypeStart;
path->newfigure = FALSE;
}
path->pathdata.Count += count;
return Ok;
return extend_current_figure(path, points, count, PathPointTypeLine);
}
GpStatus WINGDIPAPI GdipAddPathLine2I(GpPath *path, GDIPCONST GpPoint *points, INT count)
......
......@@ -329,6 +329,14 @@ static void test_line2(void)
ok_path(path, line2_path, ARRAY_SIZE(line2_path), FALSE);
GdipResetPath(path);
status = GdipAddPathLine2(path, line2_points, 3);
expect(Ok, status);
status = GdipAddPathLine2(path, &(line2_points[2]), 3);
expect(Ok, status);
ok_path(path, line2_path, 5, FALSE);
GdipDeletePath(path);
}
......
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