diff --git a/components/tvplanit/source/vpganttview.pas b/components/tvplanit/source/vpganttview.pas index 66a7219e3..4292f72d2 100644 --- a/components/tvplanit/source/vpganttview.pas +++ b/components/tvplanit/source/vpganttview.pas @@ -563,9 +563,7 @@ var m: Integer = 0; // Result of mod begin DivMod(AWidth - FixedColWidth, ColWidth, d, m); - if m <> 0 then - d := d-1; - if d < 1 then d := 1; + if (m = 0) and (d > 1) then dec(d); Result := d; end; @@ -575,9 +573,7 @@ var m: Integer = 0; // Result of mod begin DivMod(AHeight - TotalColHeaderHeight, FRowHeight, d, m); - if m <> 0 then - d := d-1; - if d < 1 then d := 1; + if (m = 0) and (d > 1) then dec(d); Result := d; end;