tune the fix

This commit is contained in:
Vincent Wei
2021-12-17 15:02:21 +08:00
parent ea83e92a16
commit bf6998672f
+8 -8
View File
@@ -2506,10 +2506,6 @@ static BOOL dc_InitSubDC (HDC hdcDest, HDC hdc, int off_x, int off_y,
/* should set after InitMemDC.*/
pdc->hwnd = pdc_parent->hwnd;
InitClipRgn (&pdc->lcrgn, &__mg_FreeClipRectList);
MAKE_REGION_INFINITE(&pdc->lcrgn);
InitClipRgn (&pdc->ecrgn, &__mg_FreeClipRectList);
CopyRegion (&pdc->lcrgn, &pdc_parent->lcrgn);
CopyRegion (&pdc->ecrgn, &pdc_parent->ecrgn);
IntersectClipRect (&pdc->ecrgn, &pdc->DevRC);
@@ -2568,6 +2564,10 @@ HDC GUIAPI GetSubDC (HDC hdc, int off_x, int off_y, int width, int height)
if (pdc == NULL)
return HDC_INVALID;
InitClipRgn (&pdc->lcrgn, &__mg_FreeClipRectList);
MAKE_REGION_INFINITE(&pdc->lcrgn);
InitClipRgn (&pdc->ecrgn, &__mg_FreeClipRectList);
if (!dc_InitSubDC((HDC)pdc, hdc, off_x, off_y, width, height)) {
pdc->bInUse = FALSE;
return HDC_INVALID;
@@ -2658,15 +2658,15 @@ HDC GUIAPI CreatePrivateSubDC (HDC hdc, int off_x, int off_y,
if (!(pdc = malloc(sizeof(DC))))
return HDC_INVALID;
InitClipRgn (&pdc->lcrgn, &__mg_FreeClipRectList);
MAKE_REGION_INFINITE(&pdc->lcrgn);
InitClipRgn (&pdc->ecrgn, &__mg_FreeClipRectList);
pdc->bInUse = TRUE;
pdc->DataType = TYPE_HDC;
/* XXX: use the parent's type */
pdc->DCType = pdc_parent->DCType;
InitClipRgn (&pdc->lcrgn, &__mg_FreeClipRectList);
MAKE_REGION_INFINITE(&pdc->lcrgn);
InitClipRgn (&pdc->ecrgn, &__mg_FreeClipRectList);
if (!dc_InitSubDC ((HDC)pdc, hdc, off_x, off_y, width, height)) {
free (pdc);
return HDC_INVALID;