Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@f-i-l-i-p
Copy link
Contributor

Fixes the bug described in #951 about incorrect cutting/pasting behavior.

Previously, the clipping operation would incorrectly include everything within the outer bounds of the selection, even when the selected area contained unselected regions.

This fix makes sure that inner regions are correctly handled as shown in the video.

2024-09-16_11.15.02.mp4

var g = new Context (surf);

// Use the EvenOdd fill rule to account for "holes" in the selection
g.FillRule = FillRule.EvenOdd;
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for looking into this!

The fix looks like the correct change, but even better would be to replace these three lines with document.Selection.Clip (g); which wraps up all of this logic

public void Clip (Context g)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the feedback! I changed it to use the Clip function.

@cameronwhite cameronwhite merged commit ab08b7b into PintaProject:master Sep 17, 2024
@f-i-l-i-p f-i-l-i-p deleted the selection branch September 17, 2024 12:48
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