From dd3fb29fe77faadb123fa99e9824a85106bb7098 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Wed, 7 Sep 2022 16:44:24 +0000 Subject: [PATCH] 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 --- components/tvplanit/source/vpganttview.pas | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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;