Conversation
…sions Fixes #2795 This fix ensures that when updating value ranges within Sliders and LabeledSliders: - If the new minimum is greater than the current maximum, we set the maximum first to avoid the validation error - If the new maximum is less than the current minimum, we set the minimum first - Otherwise, we can safely set them in the original order This prevents the intermediate state where minimum temporarily exceeds maximum, which was causing the crash when opening the settings window after changing tile dimensions.
pandinocoder
requested changes
Jan 31, 2026
Comment on lines
388
to
398
Member
There was a problem hiding this comment.
The body of these are the exact same? Just combine them (by removing the else if)
Member
There was a problem hiding this comment.
Before this if there should be a safety check ensuring that min is actually the minimum, and max is actually the maximum.
e.g.
var actualMin = Math.Min(min, max);
var actualMax = Math.Max(min, max);Then use actualMin and actualMax throughout the rest of the method.
Member
There was a problem hiding this comment.
Both comments from LabeledSlider apply here
(tested: working as intended!) Signed-off-by: Arufonsu <17498701+Arufonsu@users.noreply.github.com>
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 #2795
This fix ensures that when updating value ranges within Sliders and LabeledSliders:
This prevents the intermediate state where minimum temporarily exceeds maximum, which was causing the crash when opening the settings window after changing tile dimensions.
Note: Tested by decreasing dimensions from 32x32 to 16x16, leading to no more crashes at settings windows
