Skip to content

Commit

Permalink
Merge pull request #3179 from VisActor/3161-refactor-gantt-taskbar-re…
Browse files Browse the repository at this point in the history
…size

3161 refactor gantt taskbar resize
  • Loading branch information
fangsmile authored Dec 23, 2024
2 parents 1eb072f + 6480984 commit bbc4e32
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "fix: gantt taskbar resize width interaction can not limit one time unit #3161\n\n",
"type": "none",
"packageName": "@visactor/vtable"
}
],
"packageName": "@visactor/vtable",
"email": "[email protected]"
}
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 bbc4e32

Please sign in to comment.