Skip to content

Commit

Permalink
Merge pull request #50 from bryzZz/link-state-fix
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
chekoopa authored Oct 10, 2023
2 parents 1a54cf6 + 70d4351 commit 393c19f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/renderer/src/lib/data/StateMachine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,10 @@ export class StateMachine extends EventEmitter {

if (!parent || !child) return;

let numberOfConnectedActions = 0;
if (child.data.parent) {
this.unlinkState(childId, canUndo);
numberOfConnectedActions += 1;
}

// Вычисляем новую координату внутри контейнера
Expand All @@ -268,6 +270,7 @@ export class StateMachine extends EventEmitter {
this.undoRedo.do({
type: 'linkState',
args: { parentId, childId },
numberOfConnectedActions,
});
if (addOnceOff) {
child.addOnceOff('dragend'); // Линковка состояния меняет его позицию и это плохо для undo
Expand Down

0 comments on commit 393c19f

Please sign in to comment.