-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid node size calculation for text + flex_grow: 1.0 #9350
Comments
Looks like a bug in Taffy, since the text node is the correct size. The sample project works correctly if you replace the text node with a regular NodeBundle and a fixed size measure func. |
I have been able to reproduce this as a Taffy gentest, so I can confirm that this is (most likely) a bug in Taffy. It seems to be using the min-content size for the text when it shouldn't be, or something like that. |
…em's intrinsic main size (+misc fixes) (#522) * Add tests for bevyengine/bevy#9350 * Pass accurate cross-axis available space when computing a flexbox item's intrinsic main size * Subtract child margin not parent margin when computing stretch-alignment known size * Add extra debug logs to flexbox algorithm * Apply margins to leaf nodes when computing available space for measure functions
…em's intrinsic main size (+misc fixes) (#522) * Add tests for bevyengine/bevy#9350 * Pass accurate cross-axis available space when computing a flexbox item's intrinsic main size * Subtract child margin not parent margin when computing stretch-alignment known size * Add extra debug logs to flexbox algorithm * Apply margins to leaf nodes when computing available space for measure functions (cherry picked from commit dab541d)
…em's intrinsic main size (+misc fixes) (#522) * Add tests for bevyengine/bevy#9350 * Pass accurate cross-axis available space when computing a flexbox item's intrinsic main size * Subtract child margin not parent margin when computing stretch-alignment known size * Add extra debug logs to flexbox algorithm * Apply margins to leaf nodes when computing available space for measure functions (cherry picked from commit dab541d)
…em's intrinsic main size (+misc fixes) (#522) * Add tests for bevyengine/bevy#9350 * Pass accurate cross-axis available space when computing a flexbox item's intrinsic main size * Subtract child margin not parent margin when computing stretch-alignment known size * Add extra debug logs to flexbox algorithm * Apply margins to leaf nodes when computing available space for measure functions (cherry picked from commit dab541d)
…em's intrinsic main size (+misc fixes) (#522) * Add tests for bevyengine/bevy#9350 * Pass accurate cross-axis available space when computing a flexbox item's intrinsic main size * Subtract child margin not parent margin when computing stretch-alignment known size * Add extra debug logs to flexbox algorithm * Apply margins to leaf nodes when computing available space for measure functions (cherry picked from commit dab541d)
…em's intrinsic main size (+misc fixes) (#522) * Add tests for bevyengine/bevy#9350 * Pass accurate cross-axis available space when computing a flexbox item's intrinsic main size * Subtract child margin not parent margin when computing stretch-alignment known size * Add extra debug logs to flexbox algorithm * Apply margins to leaf nodes when computing available space for measure functions (cherry picked from commit dab541d)
…em's intrinsic main size (+misc fixes) (#522) * Add tests for bevyengine/bevy#9350 * Pass accurate cross-axis available space when computing a flexbox item's intrinsic main size * Subtract child margin not parent margin when computing stretch-alignment known size * Add extra debug logs to flexbox algorithm * Apply margins to leaf nodes when computing available space for measure functions (cherry picked from commit dab541d)
…em's intrinsic main size (+misc fixes) (#522) * Add tests for bevyengine/bevy#9350 * Pass accurate cross-axis available space when computing a flexbox item's intrinsic main size * Subtract child margin not parent margin when computing stretch-alignment known size * Add extra debug logs to flexbox algorithm * Apply margins to leaf nodes when computing available space for measure functions (cherry picked from commit dab541d)
Taffy |
@nicoburns thank you! |
Bevy version
v0.11.0
Relevant system information
Cargo:
cargo 1.71.0 (cfd3bbd8f 2023-06-08)
Adapter:
AdapterInfo { name: "Apple M2", vendor: 0, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Metal }
System:
SystemInfo { os: "MacOS 13.0 ", kernel: "22.1.0", cpu: "Apple M2", core_count: "8", memory: "16.0 GiB" }
What you did
I create multiple nodes with two
flex_grow: 1
nodes (the first one is parent of the second one) and put some text inside the second node. On the video the center red node hasflex_grow: 1
, the center green node hasflex_grow: 1
and the text added to the center green node.What went wrong
When I try to resize the window, the center green node doesn't reduce the size to match the size of the text.
Additional information
Providing width to the center green node will fix the issue
bevy_flex_grow_bug.mov
There is the sample project:
bevy-issue-flex-grow.zip
The text was updated successfully, but these errors were encountered: