mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-06 02:00:41 +02:00
LCL: added capfHasScrollOffset in Controls.FindControlAtPosition(), also fixed TGraphicControl.Update, it should take into account parent's scrolloffset if any. issues #12217,#18272
git-svn-id: trunk@31577 -
This commit is contained in:
parent
97085f283e
commit
5c16268dbe
@ -2812,7 +2812,8 @@ begin
|
||||
begin
|
||||
Result := WinControl;
|
||||
Control := WinControl.ControlAtPos(WinControl.ScreenToClient(Position),
|
||||
[capfAllowDisabled, capfAllowWinControls, capfRecursive]);
|
||||
[capfAllowDisabled, capfAllowWinControls, capfRecursive,
|
||||
capfHasScrollOffset]);
|
||||
//debugln(['FindControlAtPosition ',dbgs(Position),' ',DbgSName(WinControl),' ',dbgs(WinControl.ScreenToClient(Position)),' ',DbgSName(Control)]);
|
||||
if Control <> nil then
|
||||
Result := Control;
|
||||
|
@ -114,11 +114,15 @@ end;
|
||||
procedure TGraphicControl.Update;
|
||||
var
|
||||
R: TRect;
|
||||
Pt: TPoint;
|
||||
begin
|
||||
if Assigned(Parent) and Parent.HandleAllocated and Parent.Visible then
|
||||
begin
|
||||
R := ClientRect;
|
||||
OffsetRect(R, Left, Top);
|
||||
Pt := Parent.GetClientScrollOffset;
|
||||
OffsetRect(R, Left - Pt.X, Top - Pt.Y);
|
||||
R.Right := R.Right + Pt.X;
|
||||
R.Bottom := R.Bottom + Pt.Y;
|
||||
LCLIntf.InvalidateRect(Parent.Handle, @R, True);
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user