Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1720] Fix drop position handling #1750

Merged
merged 1 commit into from
Feb 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ It was not actually used, as tools have long been found in `DiagramDescription.g
- https://github.com/eclipse-sirius/sirius-components/issues/1692[#1692] [core] JPEG images where previously ignored if using a `.jpg` extension instead of `.jpeg`.
They are now correctly supported
- https://github.com/eclipse-sirius/sirius-components/issues/1741[#1741] [diagram] Border node placement specified with ELK configuration not taken into account anymore
- https://github.com/eclipse-sirius/sirius-components/issues/1720[#1720] [diagram] Fix the position where newly created views appear on a diagram after a drop

=== New Features

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,12 +429,12 @@ private NodeLayoutData processChildrenAreaLayoutResult(ChildrenAreaLaidOutData c
.build();
// @formatter:on

// Updates the position of the node. This update will be used by the children layout engine parent to check if
// the parent node has to increase its size because this child has been moved out the children area on top or
// left. In fact, instead of updating the node position here, we should return a data structure that will be
// used by the children parent layout engine to update the position of this node because it should be the matter
// of the parent to position its children, not a child to position itself.
if (!nodeContext.getNode().getPosition().equals(newNodePosition)) {
// Update the position of the node if it has one. This will be used by the children layout engine parent to
// check if the parent node has to increase its size because this child has been moved out the children area on
// top or left. In fact, instead of updating the node position here, we should return a data structure that will
// be used by the children parent layout engine to update the position of this node because it should be the
// matter of the parent to position its children, not a child to position itself.
if (!Position.UNDEFINED.equals(nodeContext.getNode().getPosition()) && !nodeContext.getNode().getPosition().equals(newNodePosition)) {
nodeContext.getNode().setPosition(newNodePosition);
nodeContext.getNode().setChanged(true);
for (NodeLayoutData child : nodeContext.getChildrenToLayout()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,12 +425,12 @@ private NodeLayoutData processChildrenAreaLayoutResult(ChildrenAreaLaidOutData c
.build();
// @formatter:on

// Updates the position of the node. This update will be used by the children layout engine parent to check if
// the parent node has to increase its size because this child has been moved out the children area on top or
// left. In fact, instead of updating the node position here, we should return a data structure that will be
// used by the children parent layout engine to update the position of this node because it should be the matter
// of the parent to position its children, not a child to position itself.
if (!nodeContext.getNode().getPosition().equals(newNodePosition)) {
// Update the position of the node if it has one. This will be used by the children layout engine parent to
// check if the parent node has to increase its size because this child has been moved out the children area on
// top or left. In fact, instead of updating the node position here, we should return a data structure that will
// be used by the children parent layout engine to update the position of this node because it should be the
// matter of the parent to position its children, not a child to position itself.
if (!Position.UNDEFINED.equals(nodeContext.getNode().getPosition()) && !nodeContext.getNode().getPosition().equals(newNodePosition)) {
nodeContext.getNode().setPosition(newNodePosition);
nodeContext.getNode().setChanged(true);
for (NodeLayoutData child : nodeContext.getChildrenToLayout()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,12 +429,12 @@ private NodeLayoutData processChildrenAreaLayoutResult(ChildrenAreaLaidOutData c
.build();
// @formatter:on

// Updates the position of the node. This update will be used by the children layout engine parent to check if
// the parent node has to increase its size because this child has been moved out the children area on top or
// left. In fact, instead of updating the node position here, we should return a data structure that will be
// used by the children parent layout engine to update the position of this node because it should be the matter
// of the parent to position its children, not a child to position itself.
if (!nodeContext.getNode().getPosition().equals(newNodePosition)) {
// Update the position of the node if it has one. This will be used by the children layout engine parent to
// check if the parent node has to increase its size because this child has been moved out the children area on
// top or left. In fact, instead of updating the node position here, we should return a data structure that will
// be used by the children parent layout engine to update the position of this node because it should be the
// matter of the parent to position its children, not a child to position itself.
if (!Position.UNDEFINED.equals(nodeContext.getNode().getPosition()) && !nodeContext.getNode().getPosition().equals(newNodePosition)) {
nodeContext.getNode().setPosition(newNodePosition);
nodeContext.getNode().setChanged(true);
for (NodeLayoutData child : nodeContext.getChildrenToLayout()) {
Expand Down