Commit 6f140f9b authored by Laurent Vromman's avatar Laurent Vromman Committed by Alexandre Julliard

gdi32: Add a test for CloseFigure.

parent 2b77fed4
...@@ -235,9 +235,8 @@ BOOL WINAPI CloseFigure(HDC hdc) ...@@ -235,9 +235,8 @@ BOOL WINAPI CloseFigure(HDC hdc)
} }
else else
{ {
/* FIXME: Shouldn't we draw a line to the beginning of the
figure? */
/* Set PT_CLOSEFIGURE on the last entry and start a new stroke */ /* Set PT_CLOSEFIGURE on the last entry and start a new stroke */
/* It is not necessary to draw a line, PT_CLOSEFIGURE is a virtual closing line itself */
if(dc->path.numEntriesUsed) if(dc->path.numEntriesUsed)
{ {
dc->path.pFlags[dc->path.numEntriesUsed-1]|=PT_CLOSEFIGURE; dc->path.pFlags[dc->path.numEntriesUsed-1]|=PT_CLOSEFIGURE;
......
...@@ -391,10 +391,41 @@ done: ...@@ -391,10 +391,41 @@ done:
ReleaseDC(0, hdc); ReleaseDC(0, hdc);
} }
static void test_closefigure(void) {
BOOL retb;
int nSize, nSizeWitness;
HDC hdc = GetDC(0);
BeginPath(hdc);
MoveToEx(hdc, 95, 95, NULL);
LineTo(hdc, 95, 0);
LineTo(hdc, 0, 95);
retb = CloseFigure(hdc);
EndPath(hdc);
nSize = GetPath(hdc, NULL, NULL, 0);
AbortPath(hdc);
BeginPath(hdc);
MoveToEx(hdc, 95, 95, NULL);
LineTo(hdc, 95, 0);
LineTo(hdc, 0, 95);
EndPath(hdc);
nSizeWitness = GetPath(hdc, NULL, NULL, 0);
/* This test shows CloseFigure does not have to add a point at the end of the path */
ok(nSize == nSizeWitness, "Wrong number of points, no point should be added by CloseFigure\n");
ReleaseDC(0, hdc);
}
START_TEST(path) START_TEST(path)
{ {
test_widenpath(); test_widenpath();
test_arcto(); test_arcto();
test_anglearc(); test_anglearc();
test_polydraw(); test_polydraw();
test_closefigure();
} }
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