From 6eb42f280e985d5c1941da893fa3339f5f653816 Mon Sep 17 00:00:00 2001 From: ondrej Date: Sun, 12 Jun 2016 20:26:01 +0000 Subject: [PATCH] lcl: grids: check top left after size change - also for negative values. Issue #30211 git-svn-id: trunk@52497 - --- lcl/grids.pas | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lcl/grids.pas b/lcl/grids.pas index 1a73b6fad7..8f0e91d8c3 100644 --- a/lcl/grids.pas +++ b/lcl/grids.pas @@ -4733,11 +4733,21 @@ begin begin fTopLeft.y := FGCache.MaxTopLeft.y; TLChanged := True; + end else + if FTopLeft.y < FixedRows then + begin + fTopLeft.y := FixedRows; + TLChanged := True; end; if fTopLeft.x > FGCache.MaxTopLeft.x then begin fTopLeft.x := FGCache.MaxTopLeft.x; TLChanged := True; + end else + if FTopLeft.x < FixedCols then + begin + fTopLeft.x := FixedCols; + TLChanged := True; end; FGCache.TLRowOff := Min(FGCache.TLRowOff, FGCache.MaxTLOffset.y); FGCache.TLColOff := Min(FGCache.TLColOff, FGCache.MaxTLOffset.x);