mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 17:59:16 +02:00
lcl: pass device coords for SelectClipRGN (issue #15508)
git-svn-id: trunk@25239 -
This commit is contained in:
parent
4809be32c6
commit
6f99fb6338
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user