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

Use PrecisionPoint instead of Point to handle deprecation warning #385

Merged
merged 1 commit into from
Mar 17, 2024

Conversation

ptziegler
Copy link
Contributor

This commit partially reverts fd75841 and uses PrecisionPoints instead of Points in the FanRouter class, to store the bend point.

Note that because the mid point is a plain point, the equality check is done using the integer coordinates.

Resolves #383

Copy link

github-actions bot commented Mar 16, 2024

Unit Test Results

     18 files       18 suites   40s ⏱️
   326 tests    326 ✔️ 0 💤 0
1 956 runs  1 956 ✔️ 0 💤 0

Results for commit 3bd65a7.

♻️ This comment has been updated with latest results.

@@ -67,11 +68,11 @@ protected void handleCollision(PointList points, int index) {
Point bendPoint;

if (index % 2 == 0) {
bendPoint = new Point(midPoint.x + (int) ((index / 2.0) * -1.0 * ySeparation),
midPoint.y + (int) ((index / 2.0) * xSeparation));
bendPoint = new PrecisionPoint(midPoint.x + (index / 2) * (-1 * ySeparation),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should move (index/2) to a stack variable. Would make for me the code better readable, and the I wouldn't have made the wrong clean-up if it would have been that way.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of having a separate variable, I can also just have it be part of the calculation for the xSeparation and ySeparation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea.

This commit partially reverts fd75841
and uses PrecisionPoints instead of Points in the FanRouter class, to
store the bend point.

Note that because the mid point is a plain point, the equality check is
done using the integer coordinates.

Resolves eclipse-gef#383
@azoitl azoitl merged commit 19274a2 into eclipse-gef:master Mar 17, 2024
9 checks passed
@ptziegler ptziegler deleted the issue383 branch March 17, 2024 14:55
@ptziegler ptziegler added this to the 3.20.0 milestone Mar 17, 2024
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.

Change from #347 break the FanRouter functionality
2 participants