From a96190d6a2b5f9c878f66bdc2f6fb8b232b50acc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tony=20Mass=C3=A9?= <50835088+TonyMasse@users.noreply.github.com> Date: Wed, 9 Dec 2020 00:21:18 +0000 Subject: [PATCH] fix(diagramlink): populate `positionFrom` and `positionTo` 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 #6 --- src/DiagramModel.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DiagramModel.js b/src/DiagramModel.js index 4eab3f4..75d7fbe 100644 --- a/src/DiagramModel.js +++ b/src/DiagramModel.js @@ -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 }); }