mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-17 15:09:46 +02:00
lcl: grids: scroll to highest possible value if col/row are out of valid bounds. Related to issue #31766
git-svn-id: trunk@54841 -
This commit is contained in:
parent
553d56948a
commit
5fc40612bc
@ -4688,6 +4688,7 @@ begin
|
||||
TryTL:=ScrollGrid(False,aCol, aRow);
|
||||
TLChange := not PointIgual(TryTL, FTopLeft);
|
||||
if TLChange
|
||||
or (not PointIgual(TryTL, Point(aCol, aRow)) and (goSmoothScroll in Options))
|
||||
or (ClearColOff and (FGCache.TLColOff<>0))
|
||||
or (ClearRowOff and (FGCache.TLRowOff<>0)) then
|
||||
begin
|
||||
@ -4698,6 +4699,10 @@ begin
|
||||
FGCache.TLColOff := 0;
|
||||
if ClearRowOff then
|
||||
FGCache.TLRowOff := 0;
|
||||
if (aCol>TryTL.X) and (goSmoothScroll in Options) then
|
||||
FGCache.TLColOff := FGCache.MaxTLOffset.X;
|
||||
if (aRow>TryTL.Y) and (goSmoothScroll in Options) then
|
||||
FGCache.TLRowOff := FGCache.MaxTLOffset.Y;
|
||||
{$ifdef dbgscroll}
|
||||
DebugLn('TryScrollTo: TopLeft=%s NewCol=%d NewRow=%d',
|
||||
[dbgs(FTopLeft), NewCol, NewRow]);
|
||||
|
Loading…
Reference in New Issue
Block a user