Commit 5863eabd authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

gdiplus: GdipGetPathLastPoint implementation.

parent c40c08b3
......@@ -342,7 +342,7 @@
@ stdcall GdipGetPathGradientSurroundColorsWithCount(ptr ptr ptr)
@ stub GdipGetPathGradientTransform
@ stub GdipGetPathGradientWrapMode
@ stub GdipGetPathLastPoint
@ stdcall GdipGetPathLastPoint(ptr ptr)
@ stdcall GdipGetPathPoints(ptr ptr long)
@ stdcall GdipGetPathPointsI(ptr ptr long)
@ stdcall GdipGetPathTypes(ptr ptr long)
......
......@@ -551,6 +551,20 @@ GpStatus WINGDIPAPI GdipGetPathFillMode(GpPath *path, GpFillMode *fillmode)
return Ok;
}
GpStatus WINGDIPAPI GdipGetPathLastPoint(GpPath* path, GpPointF* lastPoint)
{
INT count;
if(!path || !lastPoint)
return InvalidParameter;
count = path->pathdata.Count;
if(count > 0)
*lastPoint = path->pathdata.Points[count-1];
return Ok;
}
GpStatus WINGDIPAPI GdipGetPathPoints(GpPath *path, GpPointF* points, INT count)
{
if(!path)
......
......@@ -671,6 +671,31 @@ static void test_rect(void)
GdipDeletePath(path);
}
static void test_lastpoint(void)
{
GpStatus status;
GpPath *path;
GpPointF ptf;
GdipCreatePath(FillModeAlternate, &path);
status = GdipAddPathRectangle(path, 5.0, 5.0, 100.0, 50.0);
expect(Ok, status);
/* invalid args */
status = GdipGetPathLastPoint(NULL, &ptf);
expect(InvalidParameter, status);
status = GdipGetPathLastPoint(path, NULL);
expect(InvalidParameter, status);
status = GdipGetPathLastPoint(NULL, NULL);
expect(InvalidParameter, status);
status = GdipGetPathLastPoint(path, &ptf);
expect(Ok, status);
expect(TRUE, (ptf.X == 5.0) && (ptf.Y == 55.0));
GdipDeletePath(path);
}
START_TEST(graphicspath)
{
struct GdiplusStartupInput gdiplusStartupInput;
......@@ -693,6 +718,7 @@ START_TEST(graphicspath)
test_linei();
test_rect();
test_polygon();
test_lastpoint();
GdiplusShutdown(gdiplusToken);
}
......@@ -238,6 +238,7 @@ GpStatus WINGDIPAPI GdipCreatePath2I(GDIPCONST GpPoint*,GDIPCONST BYTE*,INT,GpFi
GpStatus WINGDIPAPI GdipDeletePath(GpPath*);
GpStatus WINGDIPAPI GdipGetPathData(GpPath*,GpPathData*);
GpStatus WINGDIPAPI GdipGetPathFillMode(GpPath*,GpFillMode*);
GpStatus WINGDIPAPI GdipGetPathLastPoint(GpPath*,GpPointF*);
GpStatus WINGDIPAPI GdipGetPathPoints(GpPath*,GpPointF*,INT);
GpStatus WINGDIPAPI GdipGetPathPointsI(GpPath*,GpPoint*,INT);
GpStatus WINGDIPAPI GdipGetPathTypes(GpPath*,BYTE*,INT);
......
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