TElTreeView.GetVisCount2 is a too simplied calcuation which doesn't respect different heights of rows
We enhance the code to this:
function TElTreeView.GetVisCount2: Integer;
var
j: Integer;
CliHeight: Integer;
begin
CliHeight := Height;
j := FOwner.FLineHeight;
// RowHeight can be different, so calculat it row by row
var diff := 0;
for var i := FOwner.TopIndex to Min(FOwner.TopIndex + FOwner.TotalVisCount, FOwner.Items.Count) - 1 do
Inc(diff, FOwner.Items[i].Height - j);
Result := (CliHeight - diff) div j;
end;
Comments