-
Notifications
You must be signed in to change notification settings - Fork 420
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(modeling): move labels + attachers with closure
Prior to this commit we adopted a complicated mechanism to move attachers and labels after the actual move closure. This commit simplifies the matter: We now add attachers and labels to the move closure and let our existing move mechanisms handle their movements, too. As a result, users can rely on the fact that all elements moved once * connection layouting is triggered * the elements.move postExecute phase is triggered :tada:
- Loading branch information
1 parent
0e587f3
commit 1688264
Showing
8 changed files
with
172 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { | ||
assign | ||
} from 'min-dash'; | ||
|
||
import { | ||
getClosure | ||
} from '../../../../util/Elements'; | ||
|
||
|
||
export default function MoveClosure() { | ||
|
||
this.allShapes = {}; | ||
this.allConnections = {}; | ||
|
||
this.enclosedElements = {}; | ||
this.enclosedConnections = {}; | ||
|
||
this.topLevel = {}; | ||
} | ||
|
||
|
||
MoveClosure.prototype.add = function(element, isTopLevel) { | ||
return this.addAll([ element ], isTopLevel); | ||
}; | ||
|
||
|
||
MoveClosure.prototype.addAll = function(elements, isTopLevel) { | ||
|
||
var newClosure = getClosure(elements, !!isTopLevel, this); | ||
|
||
assign(this, newClosure); | ||
|
||
return this; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.