Skip to content

Commit

Permalink
fix(dnd): fix calc error of bar overall drag end date
Browse files Browse the repository at this point in the history
  • Loading branch information
walkerkay committed Feb 22, 2022
1 parent 4d270c3 commit 5fba2f8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/gantt/src/components/bar/bar-drag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,8 @@ export class GanttBarDrag implements OnDestroy {
});
dragRef.moved.subscribe((event) => {
const x = this.item.refs.x + event.distance.x;
const days = differenceInCalendarDays(this.item.end.value, this.item.start.value);
const start = this.ganttUpper.view.getDateByXPoint(x);
const end = start.addDays(days);
const end = this.ganttUpper.view.getDateByXPoint(x + this.item.refs.width);
this.openDragBackdrop(this.barElement, this.ganttUpper.view.getDateByXPoint(x), end);
this.item.updateDate(start, end);
this.dragContainer.dragMoved.emit({ item: this.item.origin });
Expand Down

0 comments on commit 5fba2f8

Please sign in to comment.