In a (x, y, w, h) rectangle passed to PatBlt(), a negative w results in the rectangle drawn being (x+w, y, -w, h), and negative h results in (x, y+h, w, -h). Wine instead does (x+w+1, y, -w, h) and (x, y+h+1, w, -h), so the rectangle drawn is shifted 1 pixel row too far down and/or 1 pixel column too far right. This patch recalculates the rectangle dimensions correctly.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=27584 Signed-off-by: Damjan Jovanovic damjan.jov@gmail.com --- dlls/gdi32/bitblt.c | 11 +++++++++++ dlls/gdi32/tests/bitmap.c | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+)
On Sat, Nov 14, 2020 at 11:56:57AM +0200, Damjan Jovanovic wrote:
diff --git a/dlls/gdi32/tests/bitmap.c b/dlls/gdi32/tests/bitmap.c index fe3482671b2..a3969cf25d6 100644 --- a/dlls/gdi32/tests/bitmap.c +++ b/dlls/gdi32/tests/bitmap.c @@ -3074,6 +3074,41 @@ static void test_BitBlt(void) DeleteDC(hdcScreen); }
Hi Damjan,
The tests would be better in tests/dib.c, see under /* solid brush PatBlt */ in draw_graphics(). You could add additional PatBlt()s to the right of the existing one (the dib is 512 pixels wide).
This also begs the question what happens if the brush is patterned - is it flipped? You could add a test for that under /* 8888 DIB pattern brush */ (no need to explore every brush format, just one would be enough).
Huw.