Skip to content

Commit 28d8ba0

Browse files
committed
[NtGDI]
- Fix remaining Path test results. Include Flat Path for Stroke Path. See CORE-4990. svn path=/trunk/; revision=72628
1 parent cefd6ab commit 28d8ba0

File tree

1 file changed

+35
-18
lines changed
  • reactos/win32ss/gdi/ntgdi

1 file changed

+35
-18
lines changed

reactos/win32ss/gdi/ntgdi/path.c

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,8 @@ PATH_CheckCorners(
436436
/* In GM_COMPATIBLE, don't include bottom and right edges */
437437
if (pdcattr->iGraphicsMode == GM_COMPATIBLE)
438438
{
439-
if (corners[0].x == corners[1].x) {DPRINT1("PATH_CheckCorners GM_COMPATIBLE x\n"); return FALSE;}
440-
if (corners[0].y == corners[1].y) {DPRINT1("PATH_CheckCorners GM_COMPATIBLE y\n"); return FALSE;}
439+
if (corners[0].x == corners[1].x) return FALSE;
440+
if (corners[0].y == corners[1].y) return FALSE;
441441
corners[1].x--;
442442
corners[1].y--;
443443
}
@@ -773,7 +773,6 @@ PATH_Ellipse(
773773

774774
if (!PATH_CheckCorners(dc, corners, x1, y1, x2, y2))
775775
{
776-
DPRINT1("PATH_Ellipse bad corners\n");
777776
PATH_UnlockPath(pPath);
778777
return TRUE;
779778
}
@@ -1466,13 +1465,6 @@ PATH_FillPath(
14661465
PREGION Rgn;
14671466
PDC_ATTR pdcattr = dc->pdcattr;
14681467

1469-
if (pPath->state != PATH_Closed)
1470-
{
1471-
DPRINT("PFP : path not closed\n");
1472-
EngSetLastError(ERROR_CAN_NOT_COMPLETE);
1473-
return FALSE;
1474-
}
1475-
14761468
/* Allocate a temporary region */
14771469
Rgn = IntSysCreateRectpRgn(0, 0, 0, 0);
14781470
if (!Rgn)
@@ -1560,9 +1552,6 @@ PATH_StrokePath(
15601552

15611553
DPRINT("Enter %s\n", __FUNCTION__);
15621554

1563-
if (pPath->state != PATH_Closed)
1564-
return FALSE;
1565-
15661555
/* Save the mapping mode info */
15671556
mapMode = pdcattr->iMapMode;
15681557

@@ -2567,7 +2556,16 @@ NtGdiFillPath(HDC hDC)
25672556

25682557
pNewPath = PATH_FlattenPath(pPath);
25692558

2570-
ret = PATH_FillPath(dc, pNewPath);
2559+
if (pNewPath->state != PATH_Closed)
2560+
{
2561+
EngSetLastError(ERROR_CAN_NOT_COMPLETE);
2562+
ret = FALSE;
2563+
}
2564+
else if (pNewPath->numEntriesUsed)
2565+
{
2566+
ret = PATH_FillPath(dc, pNewPath);
2567+
}
2568+
else ret = TRUE;
25712569

25722570
PATH_UnlockPath(pNewPath);
25732571
PATH_Delete(pNewPath->BaseObject.hHmgr);
@@ -2882,8 +2880,17 @@ NtGdiStrokeAndFillPath(HDC hDC)
28822880

28832881
pNewPath = PATH_FlattenPath(pPath);
28842882

2885-
bRet = PATH_FillPath(pDc, pNewPath);
2886-
if (bRet) bRet = PATH_StrokePath(pDc, pNewPath);
2883+
if (pNewPath->state != PATH_Closed)
2884+
{
2885+
EngSetLastError(ERROR_CAN_NOT_COMPLETE);
2886+
bRet = FALSE;
2887+
}
2888+
else if (pNewPath->numEntriesUsed)
2889+
{
2890+
bRet = PATH_FillPath(pDc, pNewPath);
2891+
if (bRet) bRet = PATH_StrokePath(pDc, pNewPath);
2892+
}
2893+
else bRet = TRUE;
28872894

28882895
PATH_UnlockPath(pNewPath);
28892896
PATH_Delete(pNewPath->BaseObject.hHmgr);
@@ -2904,7 +2911,7 @@ NtGdiStrokePath(HDC hDC)
29042911
{
29052912
DC *pDc;
29062913
PDC_ATTR pdcattr;
2907-
PPATH pPath;
2914+
PPATH pPath, pNewPath;
29082915
BOOL bRet = FALSE;
29092916

29102917
DPRINT("Enter %s\n", __FUNCTION__);
@@ -2929,7 +2936,17 @@ NtGdiStrokePath(HDC hDC)
29292936
if (pdcattr->ulDirty_ & (DIRTY_LINE | DC_PEN_DIRTY))
29302937
DC_vUpdateLineBrush(pDc);
29312938

2932-
bRet = PATH_StrokePath(pDc, pPath);
2939+
pNewPath = PATH_FlattenPath(pPath);
2940+
2941+
if (pNewPath->state != PATH_Closed)
2942+
{
2943+
EngSetLastError(ERROR_CAN_NOT_COMPLETE);
2944+
bRet = FALSE;
2945+
}
2946+
else bRet = PATH_StrokePath(pDc, pNewPath);
2947+
2948+
PATH_UnlockPath(pNewPath);
2949+
PATH_Delete(pNewPath->BaseObject.hHmgr);
29332950

29342951
DC_vFinishBlit(pDc, NULL);
29352952

0 commit comments

Comments
 (0)