LCL: grids: fix UpdateCachedSizes bug that moved selected cell outside the visible area for non-standard cell sizes. Issue #30678

git-svn-id: trunk@53262 -
This commit is contained in:
ondrej 2016-10-29 14:35:04 +00:00
parent 59485fc2e9
commit 1b4e67aa7c

View File

@ -4792,8 +4792,14 @@ begin
fTopLeft.x := FixedCols;
TLChanged := True;
end;
FGCache.TLRowOff := Min(FGCache.TLRowOff, FGCache.MaxTLOffset.y);
FGCache.TLColOff := Min(FGCache.TLColOff, FGCache.MaxTLOffset.x);
if TopRow=FGCache.MaxTopLeft.y then
FGCache.TLRowOff := Min(FGCache.TLRowOff, FGCache.MaxTLOffset.y)
else
FGCache.TLRowOff := Min(FGCache.TLRowOff, RowHeights[TopRow]);
if LeftCol=FGCache.MaxTopLeft.x then
FGCache.TLColOff := Min(FGCache.TLColOff, FGCache.MaxTLOffset.x)
else
FGCache.TLColOff := Min(FGCache.TLColOff, ColWidths[LeftCol]);
if TLChanged then
TopLeftChanged;