From adfe3b5e240fa46e6fa272c8aa968f34d62f1f00 Mon Sep 17 00:00:00 2001 From: fangsmile <892739385@qq.com> Date: Mon, 23 Dec 2024 15:53:30 +0800 Subject: [PATCH] fix: gantt taskbar resize width interaction can not limit one time unit #3161 --- packages/vtable-gantt/src/state/state-manager.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/packages/vtable-gantt/src/state/state-manager.ts b/packages/vtable-gantt/src/state/state-manager.ts index 6893eba2a..bbe9111cc 100644 --- a/packages/vtable-gantt/src/state/state-manager.ts +++ b/packages/vtable-gantt/src/state/state-manager.ts @@ -661,15 +661,9 @@ export class StateManager { const progress = taskRecord[progressField]; let diffWidth = this._gantt.stateManager.resizeTaskBar.onIconName === 'left' ? -dx : dx; - let taskBarSize = taskBarGroup.attribute.width + diffWidth; - if (diffWidth < 0 && taskBarSize <= this._gantt.parsedOptions.timelineColWidth) { - diffWidth = this._gantt.parsedOptions.timelineColWidth - taskBarGroup.attribute.width; - taskBarSize += diffWidth; - } - // taskBarGroup.setAttribute('width', taskBarSize); - // if (this._gantt.stateManager.resizeTaskBar.onIconName === 'left') { - // taskBarGroup.setAttribute('x', taskBarGroup.attribute.x - diffWidth); - // } + const taskBarSize = Math.max(1, taskBarGroup.attribute.width + diffWidth); + diffWidth = taskBarSize - taskBarGroup.attribute.width; + resizeOrMoveTaskBar( taskBarGroup, this._gantt.stateManager.resizeTaskBar.onIconName === 'left' ? -diffWidth : 0,