[lua] Added autofit and sizeHint properties to Dialog (fix #5176)#5321
Merged
Conversation
Collaborator
|
clang-tidy review says "All clean, LGTM! 👍" |
Member
|
Hi @ckaiser, from the conversation we had, the idea I was thinking about the |
Collaborator
|
clang-tidy review says "All clean, LGTM! 👍" |
Member
Author
|
Updated with the top/right/bottom/left functionality, also updated the script with a dropdown for easier testing. |
Member
|
It works great 👍 I think it needs a minor fix in the |
dacap
added a commit
to dacap/aseprite
that referenced
this pull request
Aug 26, 2025
dacap
added a commit
to dacap/aseprite
that referenced
this pull request
Aug 26, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5176, makes automatic fitting the default, with
autofitset toAlign.LEFT | Align.TOP. (Note: Could've usedui::HORIZONTALandui::VERTICALsince those are more accurate for what we're doing, but they're not exposed to scripting at the moment - I could just add them, though).This property can be changed via Lua, and I've added a new read-only sizeHint property to know the size the dialog wants to be to fit all the elements.
I've also while testing encountered a bug that caused old drawn pieces of dialogs linger behind them when the bounds are changed to something smaller, so I fixed that by invalidating the old rect when resizing.
Testing script, adapted from the one by @MapleGecko