Skip to content

Commit

Permalink
fix: gantt taskbar resize width interaction can not limit one time unit
Browse files Browse the repository at this point in the history
  • Loading branch information
fangsmile committed Dec 23, 2024
1 parent 8aca8b2 commit adfe3b5
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions packages/vtable-gantt/src/state/state-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit adfe3b5

Please sign in to comment.