From 6f99fb63388a0f3f49c3eb0d35552feae5d1adb3 Mon Sep 17 00:00:00 2001 From: paul Date: Fri, 7 May 2010 11:21:56 +0000 Subject: [PATCH] lcl: pass device coords for SelectClipRGN (issue #15508) git-svn-id: trunk@25239 - --- lcl/include/canvas.inc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lcl/include/canvas.inc b/lcl/include/canvas.inc index a442874fba..853d3a8055 100644 --- a/lcl/include/canvas.inc +++ b/lcl/include/canvas.inc @@ -68,13 +68,18 @@ end; procedure TCanvas.SetClipRect(const ARect: TRect); var RGN: HRGN; + LogicalRect: TRect; begin inherited SetClipRect(ARect); {$ifndef ver2_2} if inherited GetClipping then begin {$endif} - with ARect do + // ARect is in logical coords. CreateRectRGN accepts device coords. + // So we need to translate them + LogicalRect := ARect; + LPtoDP(Handle, LogicalRect, 2); + with LogicalRect do RGN := CreateRectRGN(Left, Top, Right, Bottom); SelectClipRGN(Handle, RGN); DeleteObject(RGN);