From a5630b385816b703ca2c16fcc7ab8a5790eaefa8 Mon Sep 17 00:00:00 2001 From: Laurent Redor Date: Wed, 29 May 2024 16:53:21 +0200 Subject: [PATCH] [426] Border nodes are wrongly considered in GMFHelper.getBottomRight Because of typo, the border nodes are considered in org.eclipse.sirius.diagram.ui.internal.refresh.GMFHelper.getBottomRight(Node) when they should be ignored. Bug: https://github.com/eclipse-sirius/sirius-desktop/issues/426 --- .../sirius/diagram/ui/internal/refresh/GMFHelper.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/GMFHelper.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/GMFHelper.java index 7287d9d61b..8872b2523f 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/GMFHelper.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/GMFHelper.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2023 THALES GLOBAL SERVICES and others. + * Copyright (c) 2011, 2024 THALES GLOBAL SERVICES and others. * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at @@ -274,7 +274,7 @@ public static Dimension getBorderSize(DDiagramElementContainer ddec) { */ private static void translateWithInsets(Point locationToTranslate, Node currentNode) { NodeQuery nodeQuery = new NodeQuery(currentNode); - // bordered node are not concerned by those insets. + // Border nodes are not concerned by those insets. if (!nodeQuery.isBorderedNode()) { locationToTranslate.translate(getContainerTopLeftInsets(currentNode, false)); } @@ -789,8 +789,8 @@ public static Point getBottomRight(Node node) { int bottom = 0; for (Iterator children = Iterators.filter(node.getChildren().iterator(), Node.class); children.hasNext(); /* */) { Node child = children.next(); - // The bordered nodes is ignored - if (!(new NodeQuery(node).isBorderedNode())) { + // The border nodes are ignored + if (!(new NodeQuery(child).isBorderedNode())) { Rectangle bounds = getBounds(child); Point bottomRight = bounds.getBottomRight(); if (bottomRight.x > right) {