Skip to content

Use stable_sort instead of sort - #188

Merged
dacap merged 1 commit into
aseprite:mainfrom
martincapello:fix-packing-rect-sorting
May 29, 2026
Merged

Use stable_sort instead of sort#188
dacap merged 1 commit into
aseprite:mainfrom
martincapello:fix-packing-rect-sorting

Conversation

@martincapello

@martincapello martincapello commented May 29, 2026

Copy link
Copy Markdown
Member

While reviewing aseprite/aseprite#5829 I found the actual fix to aseprite/aseprite#5624.

So today I've learned that std::sort doesn't work the same in all platforms when the elements are equals, this is the reason why in Linux the "packed" sprite sheet presented a different result than in Windows and macOS. So using std::stable_sort makes the relative order of the original collection to stay the same when the elements are equals across all platforms.

@aseprite-bot

Copy link
Copy Markdown
Collaborator

clang-tidy review says "All clean, LGTM! 👍"

@dacap

dacap commented May 29, 2026

Copy link
Copy Markdown
Member

LGTM 👍

@dacap
dacap merged commit 026ac8e into aseprite:main May 29, 2026
12 checks passed
@martincapello
martincapello deleted the fix-packing-rect-sorting branch May 30, 2026 01:55
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.

3 participants