From 71bd5e7a944ec6f31784f4ac767d340e6cfb12d4 Mon Sep 17 00:00:00 2001 From: Katsuya HIDAKA Date: Fri, 13 Nov 2026 11:35:38 +0900 Subject: Fix vertical position of the Gantt progress line vertices. The vertices were calculated by dividing the height of the subject row into nine units, which assumed the 16px tall rows of the table based layout. Since the rows are now 20px tall, the vertices were drawn about 1.7px below the center of the task bars (1.4px lower than before), and the endpoints of issues outside the displayed range 3.6px lower than before. Place the vertices at fixed offsets from the top of the row based on the size of the task bars instead, so that they are drawn on the center of the bars regardless of the row height. --- .../controllers/gantt/chart_controller.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/javascript/controllers/gantt/chart_controller.js b/app/javascript/controllers/gantt/chart_controller.js index 6244cd496..12460e867 100644 --- a/app/javascript/controllers/gantt/chart_controller.js +++ b/app/javascript/controllers/gantt/chart_controller.js @@ -1,6 +1,12 @@ import { Controller } from "@hotwired/stimulus" const RELATION_STROKE_WIDTH = 2 +// Vertical offsets of the progress line vertices from the top of a row: +// the center of the 10px tall task bar, and slightly above and below the +// task bar for issues outside the displayed range. +const PROGRESS_LINE_TASK_CENTER = 5 +const PROGRESS_LINE_TASK_ABOVE = -2 +const PROGRESS_LINE_TASK_BELOW = 14 const SVG_NS = "http://www.w3.org/2000/svg" export default class extends Controller { @@ -382,10 +388,9 @@ export default class extends Controller { if (!$element.is(":visible")) return true const topPosition = $element.position().top - this.#drawTop - const elementHeight = $element.height() / 9 - const elementTopUpper = topPosition - elementHeight - const elementTopCenter = topPosition + elementHeight * 3 - const elementTopLower = topPosition + elementHeight * 8 + const elementTopUpper = topPosition + PROGRESS_LINE_TASK_ABOVE + const elementTopCenter = topPosition + PROGRESS_LINE_TASK_CENTER + const elementTopLower = topPosition + PROGRESS_LINE_TASK_BELOW const issueClosed = $element.children("span").hasClass("issue-closed") const versionClosed = $element.children("span").hasClass("version-closed") -- 2.51.0