LCL: TCustomGrid: fixed CacheVisibleGrid

git-svn-id: branches/fixes_1_6@50622 -
This commit is contained in:
mattias 2015-12-04 22:24:24 +00:00
parent b2bc4b4f55
commit ba5d139fbf

View File

@ -5271,7 +5271,7 @@ end;
{ Save to the cache the current visible grid (excluding fixed cells) } { Save to the cache the current visible grid (excluding fixed cells) }
procedure TCustomGrid.CacheVisibleGrid; procedure TCustomGrid.CacheVisibleGrid;
var var
CellR, GridR: TRect; CellR: TRect;
begin begin
with FGCache do begin with FGCache do begin
VisibleGrid:=GetVisibleGrid; VisibleGrid:=GetVisibleGrid;
@ -5282,18 +5282,17 @@ begin
end; end;
FullVisibleGrid := VisibleGrid; FullVisibleGrid := VisibleGrid;
if ValidGrid then begin if ValidGrid then begin
GridR := FullVisibleGrid;
if goSmoothScroll in Options then begin if goSmoothScroll in Options then begin
if TLColOff>0 then if TLColOff>0 then
GridR.Left := Min(GridR.Left+1, GridR.Right); FullVisibleGrid.Left := Min(FullVisibleGrid.Left+1, FullVisibleGrid.Right);
if TLRowOff>0 then if TLRowOff>0 then
GridR.Top := Min(GridR.Top+1, GridR.Bottom); FullVisibleGrid.Top := Min(FullVisibleGrid.Top+1, FullVisibleGrid.Bottom);
end; end;
CellR := CellRect(GridR.Right, GridR.Bottom); CellR := CellRect(FullVisibleGrid.Right, FullVisibleGrid.Bottom);
if CellR.Right>(ClientWidth+GetBorderWidth) then if CellR.Right>(ClientWidth+GetBorderWidth) then
GridR.Right := Max(GridR.Right-1, GridR.Left); FullVisibleGrid.Right := Max(FullVisibleGrid.Right-1, FullVisibleGrid.Left);
if CellR.Bottom>(ClientHeight+GetBorderWidth) then if CellR.Bottom>(ClientHeight+GetBorderWidth) then
GridR.Bottom := Max(GridR.Bottom-1, GridR.Top); FullVisibleGrid.Bottom := Max(FullVisibleGrid.Bottom-1, FullVisibleGrid.Top);
end; end;
end; end;
end; end;