Module: wine Branch: master Commit: 826c1d8700d3236b40ba56aaf25791d27e1f6924 URL: http://source.winehq.org/git/wine.git/?a=commit;h=826c1d8700d3236b40ba56aaf2...
Author: Alexandre Julliard julliard@winehq.org Date: Tue Dec 12 15:00:19 2006 +0100
gdi32: Use a more appropriate size for the default clip region.
---
dlls/gdi32/clipping.c | 19 ++++++++++++++++--- 1 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/dlls/gdi32/clipping.c b/dlls/gdi32/clipping.c index 40a556c..fc59c18 100644 --- a/dlls/gdi32/clipping.c +++ b/dlls/gdi32/clipping.c @@ -86,9 +86,22 @@ void CLIPPING_UpdateGCRegion( DC * dc ) */ static inline void create_default_clip_region( DC * dc ) { - dc->hClipRgn = CreateRectRgn(0, 0, - GetDeviceCaps( dc->hSelf, HORZRES ), - GetDeviceCaps( dc->hSelf, VERTRES )); + UINT width, height; + + if (GDIMAGIC( dc->header.wMagic ) == MEMORY_DC_MAGIC) + { + BITMAP bitmap; + + GetObjectW( dc->hBitmap, sizeof(bitmap), &bitmap ); + width = bitmap.bmWidth; + height = bitmap.bmHeight; + } + else + { + width = GetDeviceCaps( dc->hSelf, DESKTOPHORZRES ); + height = GetDeviceCaps( dc->hSelf, DESKTOPVERTRES ); + } + dc->hClipRgn = CreateRectRgn( 0, 0, width, height ); }