Open TrialDragon opened 1 month ago
Does this happen across all platforms? Can you reproduce this on main? I suspect this is actually windowing related, where we're not getting the right window size soon enough.
I know it occurs on macOS (every time it is spawned), and Linux [Fedora] (I've only seen it the first time it's spawned per run so far). I'll try to make an MRE, and then see if that works on main (I don't want to deal with migrating a whole game to main, especially when I probably should make sure this is reproducible first).
I slowed a recording of this down WAY more and cut it to the moment it switches from ingame to menu to illustrate the strange 2 frames that make up this weirdness:
https://github.com/user-attachments/assets/363f9325-9b81-4e9f-bc0d-1c772421945b
Is there a chance that this is scale factor related? It looks like this is on a mobile phone emulator? Is it consistent every run?
Nope it’s happening on my macOS build consistently in every run. Of course that also has a scaling factor but I seem to be able to corner it more down to when it got introduced.
and it seems to be an instability related to cramping multiple elements in a column that define height: 100%
Speaking of which: https://github.com/DioxusLabs/taffy/releases/tag/v0.6.0 :)
And as a result, #15844 :D I'd love if you could test with that PR.
I suspect it won't help but can you test this with #16097.
I would love to test against the new taffy release or #16097, but the problem i have is that it is practically impossible to switch my project to main
because of the dozens of dependencies i have :(
I don't have yet a simple example reproducer
You could just make a fork of bevy 14, set the taffy version to 0.6 and backport #16067 (which only changes a few lines). Don't worry yourself if that seems like too much hassle though.
Bevy version
Bevy v0.14.2
What you did
We created a main menu for our game using straight Bevy UI.
What went wrong
On spawning the main menu UI, it shifts / changes during the frame after creation. The expectation is that it would spawn with the correct layout and size, not having to shift to accommodate or conform to what is wanted, since nothing should've changed from the values passed for initial creation.
Video showcasing what I'm talking about specifically: https://github.com/user-attachments/assets/4c440f45-f723-4c69-ab23-92378c421262
Additional information
My best guess as to what this is, is some form of layout calculations being performed in Bevy UI?
We don't think it's any of our code that is causing this; it still occurs after disabling / removing any systems which may modify UI values post-creation. Tho, if this does end up being a fault in the code we wrote, rather than Bevy UI, or even just intended behavior, then sorry for making this issue and wasting time.