From 319a87c86e8f6faf0ee1bbe2dba5933843d59c07 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 4 Jun 2012 20:44:24 +0200 Subject: [PATCH] gdi32: Take into account the DIB rectangles when determining overlap for blits. --- dlls/gdi32/dibdrv/bitblt.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/gdi32/dibdrv/bitblt.c b/dlls/gdi32/dibdrv/bitblt.c index 724b7047eb7..bac5a60e365 100644 --- a/dlls/gdi32/dibdrv/bitblt.c +++ b/dlls/gdi32/dibdrv/bitblt.c @@ -438,11 +438,11 @@ static int get_overlap( const dib_info *dst, const RECT *dst_rect, int height, ret = 0; if (dst->stride != src->stride) return 0; /* can't be the same dib */ - if (dst_rect->right <= src_rect->left) return 0; - if (dst_rect->left >= src_rect->right) return 0; + if (dst->rect.left + dst_rect->right <= src->rect.left + src_rect->left) return 0; + if (dst->rect.left + dst_rect->left >= src->rect.left + src_rect->right) return 0; - src_top = (const char *)src->bits.ptr + src_rect->top * src->stride; - dst_top = (const char *)dst->bits.ptr + dst_rect->top * dst->stride; + src_top = (const char *)src->bits.ptr + (src->rect.top + src_rect->top) * src->stride; + dst_top = (const char *)dst->bits.ptr + (dst->rect.top + dst_rect->top) * dst->stride; height = (dst_rect->bottom - dst_rect->top) * dst->stride; if (dst->stride > 0) @@ -460,8 +460,8 @@ static int get_overlap( const dib_info *dst, const RECT *dst_rect, else if (dst_top < src_top) ret |= OVERLAP_BELOW; } - if (dst_rect->left < src_rect->left) ret |= OVERLAP_LEFT; - else if (dst_rect->left > src_rect->left) ret |= OVERLAP_RIGHT; + if (dst->rect.left + dst_rect->left < src->rect.left + src_rect->left) ret |= OVERLAP_LEFT; + else if (dst->rect.left + dst_rect->left > src->rect.left + src_rect->left) ret |= OVERLAP_RIGHT; return ret; }