lcl: pass device coords for SelectClipRGN (issue #15508)

git-svn-id: trunk@25239 -
This commit is contained in:
paul 2010-05-07 11:21:56 +00:00
parent 4809be32c6
commit 6f99fb6338

View File

@ -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);