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

The internal method GMFHelper.getAbsoluteBounds(Node) can be improved for containers with auto-size #426

Open
lredor opened this issue Jun 26, 2024 · 2 comments · May be fixed by #427
Open
Assignees
Milestone

Comments

@lredor
Copy link
Contributor

lredor commented Jun 26, 2024

As a reminder, this method attempts to calculate, based on the GMF data, a dimension as close as possible to the dimension that the corresponding Draw2D figure will have.

In several cases, the result is false. This method is used, for example, in the Debug view.

Here are some samples. They should probably be completed with list containers and, Vertical or Horizontal Stack containers.
image
image
image
image

@lredor
Copy link
Contributor Author

lredor commented Jun 26, 2024

The above examples can be used as starting point to check the results. The corresponding project is here: Issue426-ProjectSample.zip.

@lredor lredor changed the title The internal method GMFHelper.getAbsoluteBounds(Node, boolean) can be improved for containers with auto-size The internal method GMFHelper.getAbsoluteBounds(Node) can be improved for containers with auto-size Jun 26, 2024
lredor added a commit that referenced this issue Jun 26, 2024
Several points are handled in this commit. It should maybe split in
several commit to facilitate reviewing...

* 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.

* Other cases to details

Bug: #426
@lredor lredor linked a pull request Jun 26, 2024 that will close this issue
@lredor lredor linked a pull request Jun 26, 2024 that will close this issue
lredor added a commit that referenced this issue Jul 17, 2024
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: #426
lredor added a commit that referenced this issue Jul 17, 2024
* Add method getBottomRightInsets to use it in auto-size computation
* Consider shadow border
* Consider border nodes when computing children bottom-right corner.

Bug: #426
lredor added a commit that referenced this issue Jul 17, 2024
This compartment is an intermediate GMF Node and should not have the
same behavior when computing auto-size:
- Minimal size defined by ResizableCompartmentFigure.MIN_CLIENT_DP
- No shadow border

Bug: #426
lredor added a commit that referenced this issue Jul 17, 2024
Before this commit, this kind of container was not correctly handled.

Bug: #426
lredor added a commit that referenced this issue Jul 17, 2024
Before this commit, this kind of container was not correctly handled.

Bug: #426
lredor added a commit that referenced this issue Jul 17, 2024
@lredor lredor self-assigned this Jul 17, 2024
lredor added a commit that referenced this issue Jul 26, 2024
lredor added a commit that referenced this issue Jul 26, 2024
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: #426
lredor added a commit that referenced this issue Jul 26, 2024
* Add method getBottomRightInsets to use it in auto-size computation
* Consider shadow border
* Consider border nodes when computing children bottom-right corner.

Bug: #426
lredor added a commit that referenced this issue Jul 26, 2024
This compartment is an intermediate GMF Node and should not have the
same behavior when computing auto-size:
- Minimal size defined by ResizableCompartmentFigure.MIN_CLIENT_DP
- No shadow border

Bug: #426
lredor added a commit that referenced this issue Jul 26, 2024
Before this commit, this kind of container was not correctly handled.

Bug: #426
lredor added a commit that referenced this issue Jul 26, 2024
Before this commit, this kind of container was not correctly handled.

Bug: #426
lredor added a commit that referenced this issue Jul 26, 2024
Before this commit, this kind of container was not correctly handled.

Bug: #426
lredor added a commit that referenced this issue Jul 29, 2024
lredor added a commit that referenced this issue Jul 29, 2024
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: #426
lredor added a commit that referenced this issue Jul 29, 2024
* Add method getBottomRightInsets to use it in auto-size computation
* Consider shadow border
* Consider border nodes when computing children bottom-right corner.

Bug: #426
lredor added a commit that referenced this issue Jul 29, 2024
This compartment is an intermediate GMF Node and should not have the
same behavior when computing auto-size:
- Minimal size defined by ResizableCompartmentFigure.MIN_CLIENT_DP
- No shadow border

Bug: #426
lredor added a commit that referenced this issue Jul 29, 2024
Before this commit, this kind of container was not correctly handled.

Bug: #426
@pcdavid pcdavid added this to the v8.0.0 milestone Sep 12, 2024
lredor added a commit that referenced this issue Sep 12, 2024
Analysis: It seems that before, the code with comment "manage location
of bordered node with closest side", in GMFHelper.getAbsoluteLocation,
is called only in specific circumstances. Since recent changes, it was
called systematically, but that shouldn't be the case.

This commit also reduces the number of getAbsoluBounds methods to ease
the impact analysis.

Bug: #426
lredor added a commit that referenced this issue Sep 17, 2024
lredor added a commit that referenced this issue Sep 17, 2024
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: #426
lredor added a commit that referenced this issue Sep 17, 2024
* Add method getBottomRightInsets to use it in auto-size computation
* Consider shadow border
* Consider border nodes when computing children bottom-right corner.

Bug: #426
lredor added a commit that referenced this issue Sep 17, 2024
The code will be more logic with this refactoring and facilitate the
following changes.

Bug: #426
lredor added a commit that referenced this issue Sep 17, 2024
This compartment is an intermediate GMF Node and should not have the
same behavior when computing auto-size:
- Minimal size defined by ResizableCompartmentFigure.MIN_CLIENT_DP
- No shadow border

Bug: #426
lredor added a commit that referenced this issue Sep 17, 2024
Before this commit, this kind of container was not correctly handled.

Bug: #426
lredor added a commit that referenced this issue Sep 17, 2024
Before this commit, this kind of container was not correctly handled.

Bug: #426
lredor added a commit that referenced this issue Sep 17, 2024
Before this commit, this kind of container was not correctly handled.

Bug: #426
lredor added a commit that referenced this issue Sep 17, 2024
lredor added a commit that referenced this issue Sep 17, 2024
This test was based on some wrong bounds. The edge has been slightly
moved to retrieve the previous edge bendpoints number after collapse.

Bug: #426
lredor added a commit that referenced this issue Sep 17, 2024
The bounds for a node can be computed several times for a parent or a
child bounds calculation. This commit adds a cache to avoid computing it
again.

Bug: #426
lredor added a commit that referenced this issue Sep 17, 2024
Analysis: It seems that before, the code with comment "manage location
of bordered node with closest side", in GMFHelper.getAbsoluteLocation,
is called only in specific circumstances. Since recent changes, it was
called systematically, but that shouldn't be the case.

This commit also reduces the number of getAbsoluBounds methods to ease
the impact analysis.

Bug: #426
lredor added a commit that referenced this issue Sep 27, 2024
lredor added a commit that referenced this issue Sep 27, 2024
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: #426
lredor added a commit that referenced this issue Sep 27, 2024
* Add method getBottomRightInsets to use it in auto-size computation
* Consider shadow border
* Consider border nodes when computing children bottom-right corner.

Bug: #426
lredor added a commit that referenced this issue Sep 27, 2024
The code will be more logic with this refactoring and facilitate the
following changes.

Bug: #426
lredor added a commit that referenced this issue Sep 27, 2024
This compartment is an intermediate GMF Node and should not have the
same behavior when computing auto-size:
- Minimal size defined by ResizableCompartmentFigure.MIN_CLIENT_DP
- No shadow border

Bug: #426
lredor added a commit that referenced this issue Sep 27, 2024
Before this commit, this kind of container was not correctly handled.

Bug: #426
lredor added a commit that referenced this issue Sep 27, 2024
Before this commit, this kind of container was not correctly handled.

Bug: #426
lredor added a commit that referenced this issue Sep 27, 2024
Before this commit, this kind of container was not correctly handled.

Bug: #426
lredor added a commit that referenced this issue Sep 27, 2024
lredor added a commit that referenced this issue Sep 27, 2024
This test was based on some wrong bounds. The edge has been slightly
moved to retrieve the previous edge bendpoints number after collapse.

Bug: #426
lredor added a commit that referenced this issue Sep 27, 2024
The bounds for a node can be computed several times for a parent or a
child bounds calculation. This commit adds a cache to avoid computing it
again.

Bug: #426
lredor added a commit that referenced this issue Sep 27, 2024
Analysis: It seems that before, the code with comment "manage location
of bordered node with closest side", in GMFHelper.getAbsoluteLocation,
is called only in specific circumstances. Since recent changes, it was
called systematically, but that shouldn't be the case.

This commit also reduces the number of getAbsoluBounds methods to ease
the impact analysis.

Bug: #426
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants