mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-18 03:49:41 +02:00
designer: fix TDesignerDeviceContext.GetFormOrigin
git-svn-id: trunk@21927 -
This commit is contained in:
parent
c4c2cdc5cd
commit
76f31481a3
@ -374,11 +374,14 @@ begin
|
||||
begin
|
||||
if not GetDCOriginRelativeToWindow(DC, FForm.Handle, FFormOrigin) then
|
||||
begin
|
||||
// For some reason we cannot retrieve DC origin. It can happen for exmample
|
||||
// when DC is not controld DC but double buffer DC. Lets use another trick
|
||||
// For some reason we cannot retrieve the DC origin. It can happen for example
|
||||
// when DC is not a control DC but a double buffer DC. Lets use another trick
|
||||
if FDCControl <> nil then
|
||||
begin
|
||||
AControlOrigin := FDCControl.ClientToScreen(Point(0, 0));
|
||||
if FDCControl.Parent <> nil then
|
||||
AControlOrigin := FDCControl.Parent.ClientToScreen(FDCControl.BoundsRect.TopLeft)
|
||||
else
|
||||
AControlOrigin := FDCControl.ClientToScreen(Point(0, 0));
|
||||
FFormOrigin := FForm.ClientToScreen(Point(0, 0));
|
||||
FFormOrigin.X := AControlOrigin.X - FFormOrigin.X;
|
||||
FFormOrigin.Y := AControlOrigin.Y - FFormOrigin.Y;
|
||||
|
Loading…
Reference in New Issue
Block a user