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