tvplanit: Fix calculation of visible rows and columns in GanttView.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8456 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2022-09-07 16:44:24 +00:00
parent 6ee0fa1fea
commit dd3fb29fe7

View File

@ -563,9 +563,7 @@ var
m: Integer = 0; // Result of mod m: Integer = 0; // Result of mod
begin begin
DivMod(AWidth - FixedColWidth, ColWidth, d, m); DivMod(AWidth - FixedColWidth, ColWidth, d, m);
if m <> 0 then if (m = 0) and (d > 1) then dec(d);
d := d-1;
if d < 1 then d := 1;
Result := d; Result := d;
end; end;
@ -575,9 +573,7 @@ var
m: Integer = 0; // Result of mod m: Integer = 0; // Result of mod
begin begin
DivMod(AHeight - TotalColHeaderHeight, FRowHeight, d, m); DivMod(AHeight - TotalColHeaderHeight, FRowHeight, d, m);
if m <> 0 then if (m = 0) and (d > 1) then dec(d);
d := d-1;
if d < 1 then d := 1;
Result := d; Result := d;
end; end;