From 855301204460e690105b125ac00c4765c0a15dc9 Mon Sep 17 00:00:00 2001 From: sekelsenmat Date: Mon, 23 Aug 2010 19:01:21 +0000 Subject: [PATCH] patch from zaher dirkey, fixes cliprect under wince. see bug #17249 git-svn-id: trunk@27173 - --- lcl/interfaces/wince/wincewinapi.inc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lcl/interfaces/wince/wincewinapi.inc b/lcl/interfaces/wince/wincewinapi.inc index 78956116ed..365576aa56 100644 --- a/lcl/interfaces/wince/wincewinapi.inc +++ b/lcl/interfaces/wince/wincewinapi.inc @@ -1181,7 +1181,17 @@ end;} ------------------------------------------------------------------------------} function TWinCEWidgetSet.ExcludeClipRect(dc: hdc; Left, Top, Right, Bottom: Integer): Integer; +var + P: TPoint; begin + // Fixes the following bug: http://bugs.freepascal.org/view.php?id=17249 + if LCLIntf.GetWindowOrgEx(DC, @P) > 0 then + begin + Left := Left + P.x; + Top := Top + P.y; + Right := Right + P.x; + Bottom := Bottom + P.y; + end; Result := Windows.ExcludeClipRect(dc, Left, Top, Right, Bottom); end; @@ -1432,8 +1442,13 @@ end; ------------------------------------------------------------------------------} function TWinCEWidgetSet.GetClipBox(DC : hDC; lpRect : PRect) : Longint; +var + P: TPoint; begin Result := Windows.GetClipBox(DC, Windows.LPRECT(lpRect)); + // Fixes the following bug: http://bugs.freepascal.org/view.php?id=17249 + if LCLIntf.GetWindowOrgEx(DC, @P) > 0 then + OffsetRect(lpRect^, -P.x, -P.y); end; {------------------------------------------------------------------------------