lcl: grids: don't invalidate grid when changing bounds if not necessary. Issue #31518

git-svn-id: trunk@54733 -
This commit is contained in:
ondrej 2017-04-25 10:34:28 +00:00
parent 910b0b45e8
commit 1223f3b20a

View File

@ -6946,10 +6946,22 @@ begin
end;
procedure TCustomGrid.DoOnChangeBounds;
var
OldTopLeft: TPoint;
OldColOff, OldRowOff: Integer;
begin
inherited DoOnChangeBounds;
VisualChange;
if FUpdateCount=0 then
begin
OldTopLeft := fTopLeft;
OldColOff := FGCache.TLColOff;
OldRowOff := FGCache.TLRowOff;
UpdateSizes;
if (OldTopLeft.X<>FTopLeft.X) or (OldTopLeft.Y<>FTopLeft.Y)
or (OldColOff<>FGCache.TLColOff) or (OldRowOff<>FGCache.TLRowOff) then // reduce unnecessary repaints
Invalidate;
end;
end;
procedure TCustomGrid.KeyDown(var Key: Word; Shift: TShiftState);