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

Add a "Reverse" command to the "Order" menu #2273

Merged

Conversation

tarunprabhu11
Copy link
Contributor

@tarunprabhu11 tarunprabhu11 commented Feb 8, 2025

Closes #2271
Screenshot 2025-02-08 193630

  • If multiple noncontiguous ranges are present with the same direct parent (they're siblings in the nesting hierarchy), all the selected items should be swapped as part of the same list: [1], [2], 3, 4, [5], [6] should become [6], [5], 3, 4, [2], [1] (where [] indicates selection).
    Screenshot 2025-02-08 193704
    Screenshot 2025-02-08 193642

  • If any selected layer has a selected ancestor, only the ancestor is considered selected and all children/descendants are ignored as part of the selection.

Screenshot 2025-02-08 194022
Screenshot 2025-02-08 194006

  • If there are separate sets of selected sibling layers, and they aren't descendants of any selected layer, each set gets reversed independently as part of its own sibling set.

Screenshot 2025-02-08 194229
Screenshot 2025-02-08 194203

  • Any selected layer without at least one other selected sibling is ignored.

Screenshot 2025-02-08 194356
Screenshot 2025-02-08 194336

Copy link
Member

@Keavon Keavon left a comment

Choose a reason for hiding this comment

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

Works like a charm, thanks. Your code didn't compile for some reason (maybe you pushed a slightly outdated version?) but I fixed that by changing some mut keywords. I also cleaned up a lot of cargo fmt and cargo clippy issues, and then did a review for code style (things like starting comments with a capital letter and a space after the //). And I fixed a logic bug with the undo/redo history. Feel free to look over my diff for learning purposes. Thanks for this valuable contribution! Let me know if you need help finding the next issue to work on.

@Keavon Keavon enabled auto-merge (squash) February 11, 2025 09:28
@tarunprabhu11
Copy link
Contributor Author

Thanks! I'll do better next time.

@Keavon Keavon merged commit bf3b050 into GraphiteEditor:master Feb 11, 2025
4 checks passed
@Keavon
Copy link
Member

Keavon commented Feb 11, 2025

You're all good, this is in the range of ordinary code review tweaks, especially for a first time contribution. Welcome!

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.

Add a "Reverse" command to the "Order" menu
2 participants