Skip to content

Fix FlexBox pref/min size computation for wrapping#91

Merged
FlorianKirmaier merged 2 commits intomainfrom
flexbox-fixes
Mar 18, 2026
Merged

Fix FlexBox pref/min size computation for wrapping#91
FlorianKirmaier merged 2 commits intomainfrom
flexbox-fixes

Conversation

@FlorianKirmaier
Copy link
Contributor

Summary

  • Fixed computePrefHeight(width) and computePrefWidth(height) to simulate wrap line-breaking when the available dimension is known, instead of always reporting single-row/column sizes
  • Added getContentBias() override so JavaFX parent layouts pass the actual width/height to size computations
  • Fixed computeMinHeight(width) and computeMinWidth(height) with the same wrapping logic
  • Added test app boundary elements (right + bottom) to visually verify FlexBox respects its container bounds
  • Added 23 unit tests covering prefSize wrapping, minSize wrapping, contentBias, and single-element cases

Test plan

  • All existing FlexBox tests pass
  • New FlexBoxPrefSizeTest tests pass (23 tests)
  • Verify visually in FlexBoxTestApp that the FlexBox no longer overflows into boundary elements

🤖 Generated with Claude Code

FlorianKirmaier and others added 2 commits March 18, 2026 18:10
…apping

computePrefHeight(width) and computePrefWidth(height) ignored their argument,
so wrapping FlexBoxes always reported single-row/column sizes. Added
getContentBias() so JavaFX parent layouts pass the correct dimension, and
fixed min size methods to simulate wrap line-breaking as well.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@FlorianKirmaier FlorianKirmaier merged commit 34eef8a into main Mar 18, 2026
3 checks passed
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.

1 participant