[NTGDI][GDI32] SAI Paint Tool regression fix (#8383)

CORE-20336
Move some code in win32ss/gdi/ntgdi/dibobj.c into win32ss/gdi/gdi32/objects/bitmap.c.
Condition "YSrc = 0;" on "if (Height + YDest + 1 < ScanLines)" which fixes some gdi32:bitmap regressions.
This commit is contained in:
Doug Lyons
2025-09-27 02:01:57 -05:00
committed by GitHub
parent 435482912c
commit 34fce8a997
2 changed files with 12 additions and 10 deletions

View File

@@ -982,6 +982,17 @@ SetDIBitsToDevice(
} }
} }
if (YDest >= 0)
{
ScanLines = min(abs(Height), ScanLines);
if (YSrc > 0)
{
ScanLines += YSrc;
if (Height + YDest + 1 < ScanLines)
YSrc = 0;
}
}
/* /*
if ( !pDc_Attr || // DC is Public if ( !pDc_Attr || // DC is Public
ColorUse == DIB_PAL_COLORS || ColorUse == DIB_PAL_COLORS ||

View File

@@ -528,16 +528,7 @@ NtGdiSetDIBitsToDeviceInternal(
bmi->bmiHeader.biBitCount, bmi->bmiHeader.biBitCount,
XSrc, YSrc, XDest, YDest); XSrc, YSrc, XDest, YDest);
if (YDest >= 0) if (YDest < 0)
{
ScanLines = min(abs(Height), ScanLines);
if (YSrc > 0)
{
ScanLines += YSrc;
YSrc = 0;
}
}
else
{ {
ScanLines = min(ScanLines, abs(bmi->bmiHeader.biHeight) - StartScan); ScanLines = min(ScanLines, abs(bmi->bmiHeader.biHeight) - StartScan);
} }