From fcab827de2b0bca47c638beb80fdd6f9f57d1959 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20ROU=C3=8BN=C3=89?= Date: Fri, 19 Jan 2024 10:32:35 +0100 Subject: [PATCH] [2957] Fix custom node child previous position on layout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: https://github.com/eclipse-sirius/sirius-web/issues/2957 Signed-off-by: Florian ROUËNÉ --- CHANGELOG.adoc | 1 + .../frontend/sirius-web/src/nodes/EllipseNodeLayoutHandler.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 3ded56ce3ba..d1d09f7afe7 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -108,6 +108,7 @@ Now, for a multi-valued feature, the values are properly displayed and the delet - https://github.com/eclipse-sirius/sirius-web/issues/2786[#2786] [diagram] Fix an issue where resizing was clunky. - https://github.com/eclipse-sirius/sirius-web/issues/2912[#2912] [diagram] Send all requested node descriptions to the frontend when requested. - https://github.com/eclipse-sirius/sirius-web/issues/2678[#2678] [diagram] Fix an issue where tools from the diagram palette where not executed. +- https://github.com/eclipse-sirius/sirius-web/issues/2957[#2957] [diagram] Fix an issue where childs of custom node lose their position. === New Features diff --git a/packages/sirius-web/frontend/sirius-web/src/nodes/EllipseNodeLayoutHandler.ts b/packages/sirius-web/frontend/sirius-web/src/nodes/EllipseNodeLayoutHandler.ts index 41a8ff77249..906e4ee889b 100644 --- a/packages/sirius-web/frontend/sirius-web/src/nodes/EllipseNodeLayoutHandler.ts +++ b/packages/sirius-web/frontend/sirius-web/src/nodes/EllipseNodeLayoutHandler.ts @@ -61,7 +61,7 @@ export class EllipseNodeLayoutHandler implements INodeLayoutHandler { // Update children position to be under the label and at the right padding. directNodesChildren.forEach((child, index) => { const previousNode = (previousDiagram?.nodes ?? []).find((previouseNode) => previouseNode.id === child.id); - const previousPosition = computePreviousPosition(previousNode, node); + const previousPosition = computePreviousPosition(previousNode, child); const createdNode = newlyAddedNode?.id === child.id ? newlyAddedNode : undefined; if (!!createdNode) {