mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-22 14:39:13 +02:00
CustomDrawn: Fix TForm's MouseMove. Issue #40609.
This commit is contained in:
parent
1e7d5e9eeb
commit
2c1472b435
@ -673,11 +673,11 @@ var
|
|||||||
lParentHandle: TCDBaseControl;
|
lParentHandle: TCDBaseControl;
|
||||||
lScroll, lParentPos: TPoint;
|
lScroll, lParentPos: TPoint;
|
||||||
begin
|
begin
|
||||||
|
lParentControl := ALCLControl.Parent;
|
||||||
|
if lParentControl = nil then Exit(Point(0, 0));
|
||||||
// Iterate to find the appropriate BaseWindowOrg relative to the parent control
|
// Iterate to find the appropriate BaseWindowOrg relative to the parent control
|
||||||
Result := Point(ALCLControl.Left, ALCLControl.Top);
|
Result := Point(ALCLControl.Left, ALCLControl.Top);
|
||||||
lParentControl := ALCLControl.Parent;
|
repeat
|
||||||
while (lParentControl <> nil) do
|
|
||||||
begin
|
|
||||||
if AConsiderScrolling and lParentControl.HandleAllocated then
|
if AConsiderScrolling and lParentControl.HandleAllocated then
|
||||||
begin
|
begin
|
||||||
lParentHandle := TCDBaseControl(lParentControl.Handle);
|
lParentHandle := TCDBaseControl(lParentControl.Handle);
|
||||||
@ -691,7 +691,7 @@ begin
|
|||||||
Result.X := Result.X + lParentPos.X - lScroll.X;
|
Result.X := Result.X + lParentPos.X - lScroll.X;
|
||||||
Result.Y := Result.Y + lParentPos.Y - lScroll.Y;
|
Result.Y := Result.Y + lParentPos.Y - lScroll.Y;
|
||||||
lParentControl := lParentControl.Parent;
|
lParentControl := lParentControl.Parent;
|
||||||
end;
|
until lParentControl = nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function FormPosToControlPos(ALCLControl: TWinControl; AX, AY: Integer): TPoint;
|
function FormPosToControlPos(ALCLControl: TWinControl; AX, AY: Integer): TPoint;
|
||||||
|
Loading…
Reference in New Issue
Block a user