Closed jkb0o closed 1 year ago
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.
Taffy 0.3.13
, which includes the fix for this issue has now been released. Please cargo update
to obtain the fix :)
@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
https://github.com/bevyengine/bevy/assets/122736/80de67d7-e1dc-4861-8a4a-74db371a3a97
There is the sample project: bevy-issue-flex-grow.zip