Skip to content

Fix uniform expansion of rectangle shapes#1733

Merged
cameronwhite merged 2 commits into
PintaProject:masterfrom
stefan-dangl:dev
Sep 13, 2025
Merged

Fix uniform expansion of rectangle shapes#1733
cameronwhite merged 2 commits into
PintaProject:masterfrom
stefan-dangl:dev

Conversation

@stefan-dangl

Copy link
Copy Markdown
Contributor
  • Before, due to numerical inaccuracy rectangles were not expanded uniformly but rather drifted to one side.
  • improving readability of RectangleHandler by changing magic numbers to enum.

@cameronwhite

Copy link
Copy Markdown
Member

Could you perhaps record a quick video showing the drifting issue? I didn't notice it in my testing but I'm probably missing something

@stefan-dangl

Copy link
Copy Markdown
Contributor Author

Sure. Here are the videos:

Current version:

current-version.mp4

Fixed version:

fixed-version.mp4

Notes:

  • When trying it out, please don't forget to press the "Shift" key.
  • In case it's still working on your system I would be interested to know about your setup.

@cameronwhite cameronwhite left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the video! I had only been testing with the corner handles, which didn't show the issue

Comment thread Pinta.Tools/Handles/RectangleHandle.cs Outdated
active_handle = handles[HandlePoint.LowerRight];
}

private bool IsHigherThenWide ()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Small nitpick - this should be Than instead of Then

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch! Fixed.

- Before, due to numerical inaccuracy rectangles were not expanded
uniformly but rather drifted to one side.
- improving readability of RectangleHandler by changing magic numbers to
enum.
- Change handles array to dictionary to improve readability
@cameronwhite cameronwhite merged commit 8fe6e40 into PintaProject:master Sep 13, 2025
7 checks passed
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