lcl: grids: check top left after size change. Issue #30211

git-svn-id: trunk@52493 -
This commit is contained in:
ondrej 2016-06-12 17:41:48 +00:00
parent 7c05fefe10
commit 46c8b6c3f3

View File

@ -4696,6 +4696,7 @@ end;
procedure TCustomGrid.UpdateCachedSizes;
var
i: Integer;
TLChanged: Boolean;
begin
if AutoFillColumns then
InternalAutoFillColumns;
@ -4727,6 +4728,22 @@ begin
FGCache.ScrollHeight := FGCache.ClientHeight-FGCache.FixedHeight;
CalcMaxTopLeft;
TLChanged := False;
if fTopLeft.y > FGCache.MaxTopLeft.y then
begin
fTopLeft.y := FGCache.MaxTopLeft.y;
TLChanged := True;
end;
if fTopLeft.x > FGCache.MaxTopLeft.x then
begin
fTopLeft.x := FGCache.MaxTopLeft.x;
TLChanged := True;
end;
FGCache.TLRowOff := Min(FGCache.TLRowOff, FGCache.MaxTLOffset.y);
FGCache.TLColOff := Min(FGCache.TLColOff, FGCache.MaxTLOffset.x);
if TLChanged then
TopLeftChanged;
{$ifdef dbgVisualChange}
DebugLn('TCustomGrid.updateCachedSizes: ');
with FGCache do