-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Incorrect row ordering in UI when using FlexColumn #1214
Comments
I believe this is because in bevy the origin is the bottom left corner, and y increases as you go up. |
That is probably what is happening, but I wonder if this is the best behaviour? I do agree that the bottom left corner is the correct place for the origin, and of course the co-ordinates of the UI should be the same as for the 2d camera, etc. On the other hand, should the flex behaviour behave like the CSS flex? I (obviously) thought that it would, but if not should this be documented? (of course I understand that documentation is not the priority now, but it did confuse me a bit). |
I also had this problem with expecting it to work like CSS - didn't even think of coordinates starting bottom-left when going through my code to try and find the issue. |
There is actually an underlying bug, that may or may not be hit. I believe from experimenting that it depends how children are inserted. If using EDIT: Logged that other bug as #4397 to separate from the doc-only one here. |
order has been reversed in #6000 |
Bevy version
0.4.0
Operating system & version
Ubuntu 20.04
What you did
When using the UI code, I found that the column flex direction appeared to give the opposite behaviour to what I expected (like ColumnReverse) and ColumnReverse appears to work like I would expect Column to do. This is based on my understanding of how the CSS flex box works.
The following is a small example of the code that appears to have the issue:
What you expected to happen
I expected the text to be arranged in a column, with first above second. Like:
What actually happened
The order of the rows was reversed, with second above first. Below is a screen shot.
Additional information
I'm not sure if this is an issue with my understanding of my code, Bevy, or the upstream flex implementation. Perhaps this is only occurring on my machine?
Using Flex column reverse:
gives:
The text was updated successfully, but these errors were encountered: