Skip to content

Commit

Permalink
[3440] Compute the position of a border node after each of its moves
Browse files Browse the repository at this point in the history
Bug: #3440
Signed-off-by: Florian ROUËNÉ <florian.rouene@obeosoft.com>
  • Loading branch information
frouene committed Apr 30, 2024
1 parent b8ead13 commit 51603a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Expand Up @@ -86,6 +86,7 @@ Accordingly, `IObjectSearchService` and `IIdentityService` now handle actual `IE
- https://github.com/eclipse-sirius/sirius-web/issues/3420[#3420] [diagram] Fix an issue that prevents position reset after a rejected drag&drop.
- https://github.com/eclipse-sirius/sirius-web/issues/3422[#3422] [diagram] Fix an issue that prevents element not present on diagram to be selected on first click.
- https://github.com/eclipse-sirius/sirius-web/issues/3407[#3407] [diagram] Fix performance issue during node drag.
- https://github.com/eclipse-sirius/sirius-web/issues/3440[#3440] [diagram] Prevent a border node losing its position after being moved to another border

=== New Features

Expand Down
Expand Up @@ -85,12 +85,11 @@ export const useBorderChange = (): UseBorderChangeValue => {
change.position = movedNode.position;
change.positionAbsolute = movedNode.positionAbsolute;
}
} else {
const oldMovedNode = oldNodes.find((n) => n.id === movedNode.id);
const newPosition = findBorderNodePosition(change.position, movedNode, parentNode);
if (oldMovedNode && oldMovedNode.data.borderNodePosition !== newPosition) {
oldMovedNode.data.borderNodePosition = newPosition;
}
}
const oldMovedNode = oldNodes.find((n) => n.id === movedNode.id);
const newPosition = findBorderNodePosition(change.position, movedNode, parentNode);
if (oldMovedNode && oldMovedNode.data.borderNodePosition !== newPosition) {
oldMovedNode.data.borderNodePosition = newPosition;
}
}
}
Expand Down

0 comments on commit 51603a0

Please sign in to comment.