Skip to content

Commit 34fce8a

Browse files
authored
[NTGDI][GDI32] SAI Paint Tool regression fix (reactos#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.
1 parent 4354829 commit 34fce8a

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

win32ss/gdi/gdi32/objects/bitmap.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,17 @@ SetDIBitsToDevice(
982982
}
983983
}
984984

985+
if (YDest >= 0)
986+
{
987+
ScanLines = min(abs(Height), ScanLines);
988+
if (YSrc > 0)
989+
{
990+
ScanLines += YSrc;
991+
if (Height + YDest + 1 < ScanLines)
992+
YSrc = 0;
993+
}
994+
}
995+
985996
/*
986997
if ( !pDc_Attr || // DC is Public
987998
ColorUse == DIB_PAL_COLORS ||

win32ss/gdi/ntgdi/dibobj.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -528,16 +528,7 @@ NtGdiSetDIBitsToDeviceInternal(
528528
bmi->bmiHeader.biBitCount,
529529
XSrc, YSrc, XDest, YDest);
530530

531-
if (YDest >= 0)
532-
{
533-
ScanLines = min(abs(Height), ScanLines);
534-
if (YSrc > 0)
535-
{
536-
ScanLines += YSrc;
537-
YSrc = 0;
538-
}
539-
}
540-
else
531+
if (YDest < 0)
541532
{
542533
ScanLines = min(ScanLines, abs(bmi->bmiHeader.biHeight) - StartScan);
543534
}

0 commit comments

Comments
 (0)