From 1c56b3b5168844eb72e0dd22cbe98713c1da7b4f Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 28 Aug 2017 09:10:45 +0200 Subject: [PATCH] gdi32: Use the correct brush origin when the blit operation requires an intermediate bitmap. Signed-off-by: Alexandre Julliard --- dlls/gdi32/dibdrv/bitblt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/gdi32/dibdrv/bitblt.c b/dlls/gdi32/dibdrv/bitblt.c index f4efc8f3396..0acb23f2e3c 100644 --- a/dlls/gdi32/dibdrv/bitblt.c +++ b/dlls/gdi32/dibdrv/bitblt.c @@ -742,6 +742,7 @@ static DWORD execute_rop( dibdrv_physdev *pdev, const RECT *dst_rect, dib_info * { dib_info *dibs[3], *result = src, tmp; RECT rects[3]; + POINT origin; int width = dst_rect->right - dst_rect->left; int height = dst_rect->bottom - dst_rect->top; const BYTE *opcode = BITBLT_Opcodes[(rop >> 16) & 0xff]; @@ -788,7 +789,10 @@ static DWORD execute_rop( dibdrv_physdev *pdev, const RECT *dst_rect, dib_info * brush_org, OP_ROP(*opcode) ); break; case OP_ARGS(PAT,SRC): - pdev->brush.rects( pdev, &pdev->brush, dibs[SRC], 1, &rects[SRC], brush_org, OP_ROP(*opcode) ); + /* offset the brush origin to match the final dest rectangle */ + origin.x = brush_org->x + rects[DST].left - rects[SRC].left; + origin.y = brush_org->y + rects[DST].top - rects[SRC].top; + pdev->brush.rects( pdev, &pdev->brush, dibs[SRC], 1, &rects[SRC], &origin, OP_ROP(*opcode) ); break; } }