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

[426] Improve GMFHelper.getAbsoluteBounds method #427

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

lredor
Copy link
Contributor

@lredor lredor commented 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 marked this pull request as draft July 17, 2024 13:54
@lredor lredor force-pushed the lre/enh/426-GMFHelper branch 4 times, most recently from 44700cb to 515600d Compare July 31, 2024 12:37
@lredor lredor force-pushed the lre/enh/426-GMFHelper branch 2 times, most recently from 0878225 to a383ea5 Compare September 10, 2024 11:13
@lredor lredor changed the title [426] DRAFT - Improve GMFHelper.getAbsoluteBounds method [426] Improve GMFHelper.getAbsoluteBounds method Sep 10, 2024
@lredor lredor marked this pull request as ready for review September 10, 2024 11:16
@lredor
Copy link
Contributor Author

lredor commented Sep 10, 2024

Remaining TODO exist and all cases are not correctly handle. But this is a first step. All tests added in org.eclipse.sirius.tests.swtbot.layout.GMFHelperTest are OK now.

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
* Add method getBottomRightInsets to use it in auto-size computation
* Consider shadow border
* Consider border nodes when computing children bottom-right corner.

Bug: #426
The code will be more logic with this refactoring and facilitate the
following changes.

Bug: #426
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
Before this commit, this kind of container was not correctly handled.

Bug: #426
Before this commit, this kind of container was not correctly handled.

Bug: #426
Before this commit, this kind of container was not correctly handled.

Bug: #426
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
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
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
All classes, using methods from GMFHelper with Option as return type,
have also been modified.
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 this pull request may close these issues.

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