Module: wine Branch: master Commit: c07763b4194c3dc81391c8d74d0552f5140b18ef URL: http://source.winehq.org/git/wine.git/?a=commit;h=c07763b4194c3dc81391c8d74d...
Author: Alexandre Julliard julliard@winehq.org Date: Mon Jun 4 22:22:29 2012 +0200
gdi32: Clip output to both the DIB visible rectangle and the total DIB extents.
---
dlls/gdi32/dibdrv/dc.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/dlls/gdi32/dibdrv/dc.c b/dlls/gdi32/dibdrv/dc.c index 798a9cd..df51332 100644 --- a/dlls/gdi32/dibdrv/dc.c +++ b/dlls/gdi32/dibdrv/dc.c @@ -263,10 +263,11 @@ int get_clipped_rects( const dib_info *dib, const RECT *rc, HRGN clip, struct cl
init_clipped_rects( clip_rects );
- rect.left = 0; - rect.top = 0; - rect.right = dib->rect.right - dib->rect.left; - rect.bottom = dib->rect.bottom - dib->rect.top; + rect.left = max( 0, -dib->rect.left ); + rect.top = max( 0, -dib->rect.top ); + rect.right = min( dib->rect.right, dib->width ) - dib->rect.left; + rect.bottom = min( dib->rect.bottom, dib->height ) - dib->rect.top; + if (is_rect_empty( &rect )) return 0; if (rc && !intersect_rect( &rect, &rect, rc )) return 0;
if (!clip)