fix: clamp gantt bar title position when task starts before visible range

Resolves go-vikunja/vikunja#149
This commit is contained in:
kolaente
2026-02-19 16:08:52 +01:00
parent 7862651b12
commit df05c51457

View File

@@ -243,7 +243,9 @@ const getBarTextX = computed(() => (bar: GanttBarModel) => {
if (bar.meta?.dateType === 'endOnly') {
return getBarX.value(bar) + getBarWidth.value(bar) - 8
}
return getBarX.value(bar) + 8
// When the bar starts before the visible range, clamp text to the left edge
// so the title remains visible within the visible portion of the bar.
return Math.max(getBarX.value(bar) + 8, 8)
})
function isPartialDate(bar: GanttBarModel) {