chore(modeling/label): adjust label position to laid out connection
Closes #718
This commit is contained in:
parent
6c191590b5
commit
55ca4c8f3d
|
@ -153,8 +153,7 @@ export default function LabelBehavior(
|
|||
|
||||
function getVisibleLabelAdjustment(event) {
|
||||
|
||||
var command = event.command,
|
||||
context = event.context,
|
||||
var context = event.context,
|
||||
connection = context.connection,
|
||||
label = connection.label,
|
||||
hints = assign({}, context.hints),
|
||||
|
@ -163,11 +162,11 @@ export default function LabelBehavior(
|
|||
|
||||
|
||||
if (typeof hints.startChanged === 'undefined') {
|
||||
hints.startChanged = (command === 'connection.reconnectStart');
|
||||
hints.startChanged = !!hints.connectionStart;
|
||||
}
|
||||
|
||||
if (typeof hints.endChanged === 'undefined') {
|
||||
hints.endChanged = (command === 'connection.reconnectEnd');
|
||||
hints.endChanged = !!hints.connectionEnd;
|
||||
}
|
||||
|
||||
return getLabelAdjustment(label, newWaypoints, oldWaypoints, hints);
|
||||
|
|
|
@ -255,8 +255,8 @@ describe('modeling - label layouting', function() {
|
|||
modeling.reconnectEnd(connection, shape, { x: 294, y: 270 });
|
||||
|
||||
// then
|
||||
expect(Math.round(connection.label.x)).to.be.within(224, 228);
|
||||
expect(Math.round(connection.label.y)).to.be.within(93, 97);
|
||||
expect(Math.round(connection.label.x)).to.be.within(257, 270);
|
||||
expect(Math.round(connection.label.y)).to.be.within(240, 250);
|
||||
|
||||
}));
|
||||
|
||||
|
|
Loading…
Reference in New Issue