[ADJUSTMENT] - Prefer to expand pixel snapping sizes rather than shrink, because shrinking intrinsically sized things can force a very different result on the other axis. #67
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.
[ADJUSTMENT] - Prefer to expand pixel snapping sizes rather than shrink, because shrinking intrinsically sized things can force a very different result on the other axis.
This change was made after getting unexpected layout errors in
follow_the_leader
. The problem was that some text was laying out with intrinsic width of something like155.25424
and then we shrunk it to155.0
, which forced a line break. With the line break, the height doubled. This was a problem because the parent widget was running layout specifically to find the intrinsic size. So first the parent widget ran layout unbounded and got something like155.25424 x 78.0
. Then, the parent said "Ok, now layout at exactly 155.0 x 78.0", but this was a layout error. The text was able to shrink to155.0
wide, but that forced a 2nd line of text, which took the height up to like108
, which violated the given constraints.This PR attempts to at least handle the average case where something like this happens, by preferring to increase the width instead of decrease. I'm sure this will fail for some cases, but we need to see exactly what those are, in practice.