Skip to content

Commit

Permalink
fix(diagramlink): populate positionFrom and positionTo
Browse files Browse the repository at this point in the history
with `{x:0, y:0}` in DiagramModel.addLink(). To prevent error message when new link is created. As the link's curve cannot otherwise be drawn properly (as no `x` nor `y` yet defined for `positionFrom` and `positionTo`) until the first call to `updateLinksPositions()`.

Close gwenaelp#6
  • Loading branch information
TonyMasse committed Dec 9, 2020
1 parent 977f26c commit a96190d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/DiagramModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ class DiagramModel {
id: generateId(),
from: from,
to: to,
positionFrom: {},
positionTo: {},
positionFrom: { x: 0, y: 0 },
positionTo: { x: 0, y: 0 },
points
});
}
Expand Down

0 comments on commit a96190d

Please sign in to comment.