TTMSFNCGanttChart 1.3.3.14: dependency lines missing when one end is outside the view, long bars run away while moving, cursor still loses the bar across weekends, Exporting not set, access violations without assigned Project

Hello,

we have been reporting issues in TMS FNC Gantt Chart regularly since October 2025, since August 2026 alone in ten threads (Gantt Chart, FNC Core, VCL UI Pack), as a rule with a demo project, the exact source location and a suggested fix. You often react quickly, and we appreciate that. Still, some updates also brought new problems (FNC Core 4.5.0.1 together with the VCL UI Pack crashed on every SVG), and with 1.3.3.14 we again find errors in the basic functions of a Gantt chart: dependency lines disappear as soon as the user scrolls, a long bar runs away while it is moved with the mouse, and one point has been open since 14 August 2026, with our proposal from 21 August still unanswered.

These are not edge cases: scrolling through a schedule and moving a bar with the mouse is what every user of a Gantt chart does all day. Our next release is waiting for points 1 and 2, and for point 2 there is no workaround on our side. On our side this has meanwhile become a management issue. That is why we ask for clear answers at the end of this post.

The attached demo (GanttDragLines) reproduces everything below without any user input: it runs all tests after start and writes a log next to the exe; our run is included in the zip. The chart uses its default settings, only the dependency line colour is fuchsia so that the demo can count the line pixels. The bars are moved with WM_LBUTTONDOWN/WM_MOUSEMOVE/WM_LBUTTONUP sent to the timeline, which is the same VCL path as a real mouse; in our application the same happens with the real mouse. Versions: TMS FNC Gantt Chart 1.3.3.14, FNC Core 4.5.0.9, Delphi 13.1, VCL, Win64. Line numbers refer to the 1.3.3.14 sources.

1. Dependency lines are missing when one end lies outside the visible area

a) If the successor is not visible (below, above or right of the visible area), the line is not drawn at all, even where it runs through the visible area. Tests A2 (successor below the visible rows) and A3 (successor right of the visible days, lag of 40 working days): OnBeforeDrawGanttTimeLineDependency is not called, 0 line pixels. As far as we can see, the lines are drawn while the successor is drawn (TTMSFNCCustomGanttChart.DoOnBeforeDrawItem, DrawDependency in VCL.TMSFNCGanttChart.pas line 4847), and TTMSFNCCustomGanttTimeline.BuildDisplay only adds items whose rectangle intersects the content rect (VCL.TMSFNCGanttTimeline.pas line 7733).

b) If the predecessor lies above the top of the control, only the arrow at the successor is drawn. Test A1 (list scrolled down 4 rows): the event is called with StartPoint.Y = -52.5, and there are 0 line pixels between the top of the content and the successor. Test A1b (scrolled down only 1 row, StartPoint.Y = 37.5): 239 pixels. Test A0 (both visible): 221 pixels. In DrawDependency, the finish-to-start branch for a successor that does not start right of the predecessor (the usual case without lag) draws the vertical part and the rest only "if sp.Y > 0" (VCL.TMSFNCGanttChart.pas line 9059). The other branches have no such check.

Suggestion: draw the dependencies in a separate pass, for all dependencies whose line crosses the visible area, and leave the cutting to the clip rect instead of "sp.Y > 0".

2. A long bar runs away while it is moved with the mouse

Test B1: a bar of 60 days whose end is right of the visible days, moved in 6 steps of one day to the right. After step 1 the bar is correct, but the timeline scrolls to the end of the bar (scroll position 0 → 927), so the mouse is now over Sat 19 Dec instead of Thu 12 Nov. In step 2 the bar jumps by 37 days, in step 3 by another 38, until the end of the time range. Result: the mouse moved 6 days, the task 78 days. Test B2 (start left of the visible days, 3 steps to the left): mouse −3 days, task −10 days, and the view jumps back and forth. Test B0 (short bar, control): correct, the view does not scroll.

As far as we can see, at the end of TTMSFNCCustomGanttTimeline.HandleItemMouseInteraction (VCL.TMSFNCGanttTimeline.pas lines 18262–18265) Navigate(cls)/Navigate(cle) scrolls to the start or end of the bar after every step, and HandleMouseMove (line 8133, FSizeCell := cl) then uses the cell under the mouse in the scrolled view as the base for the next step.

Suggestion: navigate to the cell under the mouse, or scroll only when the mouse reaches the edge of the view. If you prefer not to change the default behaviour, an opt-in property would be fine for us.

3. The bar still runs ahead of the mouse across weekends (item 2 of TTMSFNCGanttChart 1.3.3.6: resizing a task corrupts PlannedDuration (whWorkDaysOnly) , open since 14 August 2026)

We reported this on 14 August 2026. On 18 August you answered that it needs more investigation, because a change could break existing applications. On 21 August we explained why it matters for construction schedules (after about eight weeks of dragging the offset is more than two weeks) and suggested an opt-in property that keeps the current behaviour as the default, so existing applications are not affected. That post has not been answered, and the code is unchanged in 1.3.3.14.

Test C: 3 working days, whWorkDaysOnly, Mon–Fri, 10 steps of one day to the right. Until the first weekend the bar follows the mouse, and when its start falls on a Sunday it correctly moves to Monday. From then on the bar is ahead of the mouse: 1 day in step 6, 2 days in steps 7 to 9, 4 calendar days after the second weekend. Result: the mouse moved 10 days, the task 14 days. TTMSFNCCustomGanttChart.DoOnBeforeMoveItem (VCL.TMSFNCGanttChart.pas lines 5057/5063) shifts the start with ShiftTimeNext/ShiftTimePrevious, and the next step adds the mouse movement to that shifted start. The commented-out mouseTime lines (5040–5049) look like the right idea.

Suggestion: compute the new start from the cell under the mouse at button down plus the total mouse movement, so the grab offset stays constant, behind an opt-in property as proposed in 27206. We would appreciate a decision on this point.

4. OnBeforeDrawGanttListNodeText: ADrawingParams.Exporting is not set

Test D: 5 paints of the task list on screen give 150 calls, Exporting = True in all 150. In TTMSFNCCustomGanttChart.DoOnTaskListBeforeDrawNodeText (VCL.TMSFNCGanttChart.pas line 5345 ff.) the field Exporting of the local record is never assigned, unlike in the other task list events (dp.Exporting := False in lines 5279, 5295, 5322 and 5339), so its value is whatever is on the stack.

Suggestion: dp.Exporting := False; there as well.

5. Access violations when the chart uses its default project (Project not assigned)

Some methods of TTMSFNCCustomGanttChart read the field FProject, which is nil when no project is assigned, instead of the property Project, which returns FDefaultProject in that case. This affects a chart created at runtime; a chart placed on a form at design time is not affected as far as we can see, because the form file stores Project = DefaultProject. All three cases raise an EAccessViolation in the demo (call stacks from the debugger):

  • E1, Project := nil after an own project was assigned: SetProject → AssignInternalProjectEvents → "if Assigned(Project) then FProject.RegisterNotifyOwner(Self)" (VCL.TMSFNCGanttChart.pas lines 3413–3415). Project is never nil there, FProject is.
  • E2, moving a whWorkDaysOnly bar by one day: DoOnBeforeMoveItem → ShiftTimeNext → WorkDaysCheck → FProject.WorkTime (lines 7699–7703; also line 7740 for whWorkTimeAndDays, and ShiftTimePrevious lines 7770–7774).
  • E3, clicking the header of a sortable column (SortMethod gtsNormal): TTMSFNCCustomGanttList.HandleMouseUp → OnCustomColumnSort → DoOnCustomColumnSort → FProject.Sort (line 5187). The tasks stay unsorted.

Suggestion: use Project in these places; in AssignInternalProjectEvents check Assigned(FProject), since the default project registers itself in CreateDefaultProject. The FMX unit has the same lines. Our application assigns a project, so point 5 does not affect us; we ran into it while building the demo.

What we ask for

  1. Please confirm each of the five points.
  2. Please tell us in which version points 1 and 2 will be fixed, and let us know your decision on point 3.
  3. The attached demo needs no user input and logs every case together with the expected values. Feel free to use it as a regression test; we would be glad if it helped to catch such cases before a release.

Thank you for looking into this.

GanttDragLines_1.3.3.14.zip (13.1 KB)

Hello,

Thank you for the detailed report and the demo, which let us reproduce and confirm each of your points.
We are in the process of applying improvements and fixes to all of these issues. The goal is to release TMS FNC GanttChart 1.3.3.15 next week.

For issue 3, we are going to add an opt-in property under Interaction, which will be set to False by default. When it is True, the new start is the start at mouse down plus the total mouse movement, and the snap is applied only once.

Thank you for the quick confirmation and for adopting the opt-in for point 3. We will test 1.3.3.15 as soon as it is available and report back here.

Hello,

in addition to the five points of my first post, here are three more findings in the export of TMS FNC Gantt Chart 1.3.3.14 (FNC Core 4.5.0.9, Delphi 13.1, VCL, Win64) and one feature request. Point 6 lets the PDF export and printing fail with an exception for ordinary schedules, so we would be glad if it could still go into 1.3.3.15. Line numbers refer to VCL.TMSFNCGanttChart.pas 1.3.3.14.

The attached demo (GanttExportColumnWidth) reproduces points 6 and 7 with a plain TTMSFNCGanttChart, TTMSFNCGanttProject and TTMSFNCGanttChartPDFIO, all created at runtime with their default settings. Changed are only the task list columns (six columns with fixed widths), the page orientation, the margins and FitToPage. It runs four PDF exports after start and writes a log next to the exe; our runs are included in the zip.

6. ERangeError "Range check error" when a task list column is wider than the printable width (FitToPage = False)

The PDF export (TTMSFNCGanttChartPDFIO.Save) stops with ERangeError as soon as a task list column that starts a new horizontal page band is wider than the printable width on its own. Printing via TTMSFNCGanttChartPrintIO fails the same way; we took the call stack for the PDF export only. Example: A4 portrait with 10 mm margins (printable width 539 pt) and a column of 600 pt fails; the same in landscape (786 pt) works. It also happens without range checking, because the RTL itself raises the error for a negative dynamic array length.

Call stack (debugger):

System.Error(reRangeError)
System.DynArraySetLength / System._DynArraySetLength
VCL.TMSFNCGanttChart.InitColumns
TTMSFNCCustomGanttChart.DrawExportTaskList   (StartColumn = 10, LastColumn = 1)
TTMSFNCCustomGanttChart.ExportView           (ARect = 0, 0, 595, 842)
TTMSFNCCustomGanttChartPDFIO.DoPDFExport
TTMSFNCCustomPDFIO.Save

Cause: GetTaskListLastColumn, the local function of ExportView (line 10277), starts with Result := 1 (line 10284) and updates Result only for a column that still fits. If the first column of the band (AStartCol) does not fit on its own, the function returns 1, whatever AStartCol is. ExportView then passes StartColumn = AStartCol and LastColumn = 1 to DrawExportTaskList (lines 10599–10607), and InitColumns calls SetLength(colWidths, LastColumn - StartColumn + 1) (line 9124), here 1 - 10 + 1 = -8.

From reading the code, not tested separately: with AStartCol = 2 the length is 0, nothing is drawn and lastTaskCol does not advance, so the export would keep adding pages without progress; with AStartCol = 1 the result is correct by chance. In this case maxTaskW also keeps the value of the previous band (line 10292 is skipped), so drawParams.Rect gets the wrong width (270 pt in the call above).

With FitToPage = True the error does not occur, because GetScales shrinks the task list to the page width (demo test T3).

Suggestion: return at least AStartCol, so that an oversized column gets a band of its own (the export already clips the last column of a band), and set maxTaskW to Min(column width, printable width) in that case.

Until a fix is available, we limit the export column widths to the printable width.

7. Memory leak after the aborted PDF export

After the exception of point 6, FastMM reports on shutdown (demo):

73 - 88 bytes: TTMSFNCPDFGraphicsLibOutputWriterStream x 1

In our application the report additionally lists a leaked medium block of 8232 bytes. Without the failing test (demo started with /skipbug) there is no leak report. It looks as if the output writer stream of the PDF library is not released when an exception occurs during Save. We have not looked into that code. Could you check whether Save cleans up (stream, file) when the export raises an exception?

8. The export geometry depends on the screen DPI

ExportView draws in points (PDF) or 1/100 inch (printing), but several places in the export path use ScalePaintValue, that is the DPI scale of the control on the screen:

  • task bars: InflateRectEx(ir, 0, ScalePaintValue(-2)) (line 9698), likewise lines 9594 and 9611;
  • task text: InflateRectEx(tr, ScalePaintValue(-2), ScalePaintValue(-2)) (line 9811);
  • timeline header cells: lines 9426 and 9486 (the rectangle passed to OnBeforeDrawGanttTimeLineTimeText is the cell minus 2 × ScalePaintValue(2));
  • dependency lines: the export calls DrawDependency with AUnitWidth in export units and AExporting = True (line 9623), and DrawDependency still applies ScalePaintValue(AUnitWidth / 2) and ScalePaintValue(AUnitWidth / 3) (lines 8978, 8983, 9005–9013).

So the same schedule exports differently depending on the Windows scaling of the monitor. By calculation, not measured: with an item height of 18, the text rectangle of a bar is ItemHeight − 8 × scale high, that is zero at 225 % and negative above.

Suggestion: use the unscaled values in the export path (ScalePaintValue only when not exporting).

9. Feature request: scale the whole export, including fonts

A common requirement for printed schedules is to get a whole schedule onto one page. For example, 99 tasks over three years fit on one A4 landscape page if everything, including the text, is scaled down (to about 3.6 pt in this case). With the Gantt export this is not possible today:

  • FitToPage shrinks the timeline and the rows, but not the fonts, and keeps at least 5 export units per day (GetTimeLineScale).
  • TTMSFNCGanttChartExportOptions.TimelineUnitWidth is an Integer, so at least 1 pt per day; three years are more than 1,000 pt.
  • The task list text in the export is always Arial 10 in our application, although the task list uses a different font and size. Which property controls the font of the exported task list?

Could you add an export option for a uniform scale factor (everything including fonts, comparable to "Adjust to x % of normal size" or "Fit to n pages wide by m tall" in MS Project), or let FitToPage scale the fonts as well and drop the minimum of 5 units, and make TimelineUnitWidth a Single?

Point 6 is the most urgent one for us. Thank you for looking into this.

GanttExportColumnWidth.zip (5.9 KB)

Hi,

We'll look to apply fixes to issue 6 and 8 before the 1.3.3.15 release.

Issue 7 is going to be fixed in the next FNC Core version.

Feature request: We'll try to look into the possibilities for this, but it might not make it into 1.3.3.15.
For the font, did you try Appearance.TaskListAppearance.Font/HeaderFont? Alternatively if you enabled TTMSFNCGanttChartExportOptions.UseCustomTaskListAppearance, then you might want to try CustomTaskListAppearance.Font/HeaderFont.

Hi Tünde,

thank you, that sounds good - we are looking forward to 1.3.3.15.

Regarding the font: your hint was right, the mistake was on our side. We already use UseCustomTaskListAppearance and copy Appearance.TaskListAppearance into CustomTaskListAppearance before exporting. At runtime our application assigns the user's program font (on our machines Arial, 10 pt) to Appearance.TaskListAppearance.Font, which overrides the Segoe UI from the form file. With Segoe UI 12 as program font, the export uses Segoe UI 12 as expected. Sorry for the noise.

Hi Tünde,

thank you for TMS FNC Gantt Chart 1.3.4.0 and FNC Core 4.5.0.11. We have installed both and tested all points of this thread – in the demos from posts 1 and 4 without any workaround, and in our application (Delphi 13.1, VCL, Win64) at 100 % and 150 % Windows scaling. Below is our feedback, one new finding in 1.3.4.0 (point 10, the important one for us) and two cosmetic points in the PDF export (11 and 12). Line numbers refer to VCL.TMSFNCGanttChart.pas 1.3.4.0.

Feedback on points 1–9

  • 1, 2, 4, 5 and 6: fixed. Dependency lines are drawn when one end lies outside the visible area (confirmed in the demo and in our application), long bars no longer run away while dragging, Exporting is set, no access violation without a project, and a column wider than the page gets a band of its own instead of the ERangeError (demo test T4).
  • 3: MoveKeepsGrabPosition works. In the demo the bar moves 10 days instead of 14, and in our application with working days the bar now stays under the mouse across weekends. We have switched it on.
  • 7: no longer reproducible with the demo, because point 6 no longer raises an exception. The change in TTMSFNCPDFGraphicsLibOutputWriter.Destroy looks right to us.
  • 8: fixed. At 150 % the bars, milestones and arrows in the PDF are now identical to 100 % (the arrow heads were larger before). For the fonts see point 10.
  • 9: thank you very much for FitToPagesWide and FitToPagesTall. We keep our own "fit to one page" solution for the moment and will look at switching later.

The change for FDownNode/FDragNode from thread 27417 is in 1.3.4.0 as well – thank you. That thread is closed, so I mention it here.

10. New in 1.3.4.0: exported timeline fonts are too small at Windows scaling other than 100 %

At 150 % the texts in the timeline header and in the bars are exported at 7 pt instead of 10 pt in the PDF, and printing via TTMSFNCGanttChartPrintIO shows them at about 72 % of their size as well. With 1.3.3.14 the same schedule was exported at 10 pt at 150 %. The task list is not affected in our case, because we export it with UseCustomTaskListAppearance.

Cause, as far as we can see: with UseCustomTimeLineAppearance = False the export now calls UnscaleExportFont for TimeGroupFont, TimeFont and the task font (GetTimelineTaskAppearance with AExporting = True), and UnscaleExportFont sets Font.Height := Round(Font.Height / PaintScaleFactor) (line 9259). This assumes that the height of the font was scaled together with the control. Our application assigns its program font to these fonts at runtime – a VCL TFont taken from a form. At 150 % this font has PixelsPerInch = 144 and Height = -20, which is already 10 pt. After the division it has Height = -13 at PixelsPerInch = 144, that is 6.5 pt, and since the PDF engine takes Font.Size (VCL.TMSFNCGraphicsPDFEngine, line 1110), the PDF gets 7 pt. Rounding is unscaled in the same way; we see a smaller corner radius on a few bars, presumably for the same reason.

From our analysis it should be reproducible by assigning a form font to Appearance.TimeLineAppearance.TimeFont at runtime in a per-monitor DPI aware application on a 150 % monitor and exporting to PDF. We have not built a separate demo for this; if it helps, we can do that.

Suggestion: unscale only fonts whose height actually follows the DPI scaling of the control (Font.PixelsPerInch may help to tell them apart), or add an export option to switch the unscaling of fonts and rounding off for applications that handle DPI themselves.

Until then we assign the original fonts back to AGraphics.Font in OnBeforeDrawGanttTimeLineGroupTimeText, OnBeforeDrawGanttTimeLineTimeText and OnBeforeDrawGanttTimeLineItem while exporting, and set the rounding again. With that, the PDF at 150 % has the same font sizes as at 100 %.

11. The outer lines of the timeline are only half as thick as the lines of the task list

We noticed that some lines in the exported schedule are not drawn cleanly. Points 11 and 12 are still present in 1.3.4.0 according to the code (DrawExportTimeLineGrid only has the DPI changes, the clip in ExportView is unchanged); the measurements below were taken with 1.3.3.14, in PDF points on pages rendered at 600 dpi.

ExportView draws the timeline inside AGraphics.ClipRect(drawParams.Rect) (lines 10884–10887). Lines that lie exactly on the edge of this rectangle are stroked centred on the edge, so their outer half is clipped away. The task list is drawn without this clip and keeps the full line width, which shows as a step at the corner between task list and timeline.

You can see it in the PDF of test T1 of the GanttExportColumnWidth demo from my post 4 (default appearance), page 2, at about 800 % zoom: the top edge of the task list covers y = 27.5–28.5, the top edge of the timeline only y = 28.0–28.5. The left, right and bottom edges of the timeline are 0.5 pt as well (x = 628.0–628.5, x = 802.5–803.0, y = 379.5–380.0).

Below the header, the frame itself does not survive at all: DrawExportTimeLineGrid draws the frame first (DrawRectangle, line 9547), and the fills of the time units (line 9584, from Top + HeaderHeight to Bottom) then cover its inner half. What remains at the left, right and bottom edge is the inner half of the first and the last vertical line (lines 9730 and 9738) and of the last row line (line 10053), in the lighter colour of these lines.

A related detail: the right edge line (lines 9736–9738) is drawn with whatever stroke the loop assigned last – VerticalStroke if the last column starts a header cell, otherwise HeaderStroke (lines 9589/9594). With TimeLineUnit = gtuWeek the right edge in our export is therefore darker than all other vertical lines. From reading the code, not tested: with UseCustomTimeLineAppearance = True the frame itself has no stroke assigned either, because lines 9537–9540 assign only the fill.

Suggestion: draw the outer frame of the timeline last, after the grid and the items, and without the clip – for example in ExportView after RestoreState (line 10887) – or with the clip rect inflated by half the stroke width. And assign the stroke explicitly before lines 9547 and 9736.

We cannot work around this cleanly on our side: in an override of DrawExportTimeLine the clip of ExportView is already active, and a frame moved inwards by half the stroke width no longer lines up with the task list.

12. The bottom line of the timeline header is half as thick under all but the first unit of a header cell

With TimeLineUnit = gtuWeek (and, from the code, also gtuMonth) a header cell spans several time units. For each time unit, DrawExportTimeLineGrid first draws the fill of the column (line 9584, from Top + HeaderHeight, Stroke.Color = gcNull) and then, only at the start of a header cell, the header cell with its border (line 9686). The fills of the following units are drawn after the header cell and cover the lower half of its bottom line. In our PDF export with weeks, the bottom line of the header is 1.0 pt thick under the first day of each week and 0.5 pt under the other six days (y = 128.5–129.5 and 128.5–129.0), so it looks like a line that keeps changing its thickness. Printing via TTMSFNCGanttChartPrintIO does not show it in our tests.

Suggestion: draw the fills of all time units in a loop of their own, before the header cells and the vertical lines.

Until then we draw the bottom line of the header once more after inherited in an override of DrawExportTimeLine, for the PDF export only. We will remove it once the export is fixed.

Thank you!

Hi,

Thank you for reporting these, we applied some further improvements to the issues above. Could you please check with 1.3.4.1?

Hi,

thank you for 1.3.4.1. We have tested points 10–12 with the GanttExportColumnWidth demo from post 4 and in our application (Delphi 13.1, VCL, Win64) at 100 % and 150 % Windows scaling. Line numbers refer to VCL.TMSFNCGanttChart.pas 1.3.4.1.

10. Fonts at 150 % – solved. We now set UnscaleFontsAndRounding := False in the export options for PDF and print and have removed our workaround. At 150 % the timeline texts are exported at 10 pt again, the same as the task list. The result is identical to what our workaround produced: apart from the date and ID, the PDF content is byte-identical, and printing via TTMSFNCGanttChartPrintIO gives the same output too. Thank you for the option.

11. Outer lines of the timeline – solved. In the PDF of test T1 (page 2) the top edge of the timeline is now as thick as the edge of the task list, and the left, right and bottom edges have the full width as well. The bottom line of the task list header, which row 1 used to cover by half, is complete now too.

12. Bottom line of the timeline header – solved, one small detail remains. The fills no longer cover the line; with weeks it now has the same thickness under every day. A similar, smaller effect remains where vertical lines meet the header: the vertical grid lines start exactly at Top + HeaderHeight (line 9769), i.e. on the centre of the header’s bottom line, and they are drawn after the header cell. DrawExportDependencies clips at the same y (line 9807). So every vertical grid line and every dependency line that reaches the header covers the lower half of the bottom line for the width of its stroke – about 1 × 0.5 pt, light grey at grid lines, in the dependency colour at dependency lines. In our PDF export with weeks, the content stream shows the header cell “203 727 m 378 727 l 378 681 l 203 681 l h B” and after it the grid line “203 681 m 203 51 l S” in the vertical stroke colour. It is only visible at high zoom, so low priority. We have seen it in the PDF export and have not checked printing for this detail.

Suggestion: start the vertical lines and the clip in DrawExportDependencies half a stroke width lower, or draw the bottom line of the header once more after the content, e.g. in DrawExportTimeLineFrame. Until then we keep drawing that line once more after inherited in our DrawExportTimeLine override (PDF export only).

We also noticed that ExportView now raises an exception instead of looping endlessly when the content does not fit – we catch it and show our own short message. With the settings our print dialog allows, it was not raised in our tests.

Thank you!