From 79cfe6aad2117574668ddf9b8b6e852655a513ec Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Fri, 2 Sep 2022 20:15:51 +0000 Subject: [PATCH] tvplanit: Fix width of initial month in TVpGanttView git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8439 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/tvplanit/source/vpganttview.pas | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/tvplanit/source/vpganttview.pas b/components/tvplanit/source/vpganttview.pas index cf1aae703..fa068b359 100644 --- a/components/tvplanit/source/vpganttview.pas +++ b/components/tvplanit/source/vpganttview.pas @@ -1281,6 +1281,8 @@ begin nDays := DayOf(FEndDate) else nDays := DaysInMonth(dm); + if dm + nDays > FEndDate then + nDays := trunc(FEndDate) - trunc(dm); x2 := x1 + nDays * ColWidth; FMonthRecords[i].Rect := Rect(x1, y1, x2, y2); FMonthRecords[i].Date := dm;