FlexBoxLayout: fix min-width/min-height axis confusion for column direction#11041
Merged
dfaure-kdab merged 1 commit intoslint-ui:masterfrom Mar 19, 2026
Merged
Conversation
…ection
flexbox_layout_info() selected cells/padding/spacing using a
(direction, orientation) match. The intention was to pick the
main-axis cells for a main-axis query and cross-axis cells for a
cross-axis query. But the match was wrong:
(Column, Vertical) → main axis → should use cells_v (heights)
but selected cells_h (widths)
(Column, Horizontal) → cross axis → should use cells_h (widths)
but selected cells_v (heights)
For a column layout with items wider than tall (e.g. width=80px,
height=40px), this caused:
- min-height reported as 80px (max item width) instead of 40px
- min-width reported as 40px (max item height) instead of 80px
Fix: select cells/padding/spacing by orientation alone — height
queries always use cells_v, width queries always use cells_h,
regardless of flex direction.
The bug was visible in flexbox-interactive.slint when selecting
Flex Direction: Column, and trying to shrink the window height
as much as possible - it didn't shrink all the way to the height
of the one row of items.
ogoffart
approved these changes
Mar 19, 2026
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.
flexbox_layout_info() selected cells/padding/spacing using a
(direction, orientation) match. The intention was to pick the
main-axis cells for a main-axis query and cross-axis cells for a
cross-axis query. But the match was wrong:
(Column, Vertical) → main axis → should use cells_v (heights)
but selected cells_h (widths)
(Column, Horizontal) → cross axis → should use cells_h (widths)
but selected cells_v (heights)
For a column layout with items wider than tall (e.g. width=80px,
height=40px), this caused:
Fix: select cells/padding/spacing by orientation alone — height
queries always use cells_v, width queries always use cells_h,
regardless of flex direction.
The bug was visible in flexbox-interactive.slint when selecting
Flex Direction: Column, and trying to shrink the window height
as much as possible - it didn't shrink all the way to the height
of the one row of items.