-
Notifications
You must be signed in to change notification settings - Fork 415
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(layout): allow moving of source point on straight layouting
Related to bpmn-io/bpmn-js#574
- Loading branch information
Ricardo Matias
committed
Jun 21, 2016
1 parent
8468695
commit 1a95fcd
Showing
2 changed files
with
62 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -291,6 +291,30 @@ module.exports.layoutStraight = function(source, target, start, end, hints) { | |
primaryAxis = 'y'; | ||
} | ||
|
||
if (hints.moveSource) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
ricardomatias
Contributor
|
||
|
||
if (!isInRange(primaryAxis, end, source)) { | ||
return null; | ||
} | ||
|
||
axis[primaryAxis] = end[primaryAxis]; | ||
|
||
return [ | ||
{ | ||
x: axis.x !== undefined ? axis.x : start.x, | ||
y: axis.y !== undefined ? axis.y : start.y, | ||
original: { | ||
x: axis.x !== undefined ? axis.x : start.x, | ||
y: axis.y !== undefined ? axis.y : start.y | ||
} | ||
}, | ||
{ | ||
x: end.x, | ||
y: end.y | ||
} | ||
]; | ||
} | ||
|
||
if (!isInRange(primaryAxis, start, target)) { | ||
return null; | ||
} | ||
|
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
TODO: Document this hint. What does it do? Is this the appropriate name?