Skip to content

Use a fixed margin for bounding rectangle rather than a ratio of node size#470

Merged
paceholder merged 2 commits intopaceholder:masterfrom
Malcohol:Malcohol/absoluteBoundingRectangleSize
Jun 9, 2025
Merged

Use a fixed margin for bounding rectangle rather than a ratio of node size#470
paceholder merged 2 commits intopaceholder:masterfrom
Malcohol:Malcohol/absoluteBoundingRectangleSize

Conversation

@Malcohol
Copy link
Copy Markdown
Contributor

@Malcohol Malcohol commented May 24, 2025

The current ratio-based calculation for bounding rectangle leads to a weird situation where the mouse does not necessarily select the nearest node. In the screenshot, the mouse is selecting the top node rather than the nearer node on the left:
Screenshot from 2025-05-24 08-07-46

This PR fixes the problem using a fixed value (twice the port spacing) as the extra margin. Since the required information is not available in the AbstractNodeGeometry, the boundingRect method has been made pure virtual and implementations are provided in DefaultHorizontalNodeGeometry and DefaultVerticalNodeGeometry.

@Malcohol Malcohol changed the title Use an fixed margin for bounding rectangle rather than a ratio of node size Use a fixed margin for bounding rectangle rather than a ratio of node size May 24, 2025
@paceholder paceholder merged commit 3ed0391 into paceholder:master Jun 9, 2025
2 of 3 checks passed
Jan-Felix-Langenbach-casaGeo added a commit to casaGeo-Data-Services-GmbH/nodeeditor that referenced this pull request Sep 7, 2025
The issue was fixed upstream (see paceholder#470) in commit
3ed0391.

This reverts commit 551b609.
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.

2 participants