-
Notifications
You must be signed in to change notification settings - Fork 125
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
Unexpected result when using uiVerticalStack and uiHorizontalStack #1735
Comments
You can either: val sceneWidth = width
val sceneHeight = height
uiVerticalStack(sceneWidth, adjustSize = false) {
uiHorizontalStack(100f, adjustHeight = false) {
solidRect(100, 100, Colors.BLUE)
solidRect(100, 100, Colors.RED)
solidRect(100, 100, Colors.GREEN)
solidRect(100, 100, Colors.YELLOW)
}
uiHorizontalStack(100f, adjustHeight = false) {
solidRect(100, 100, Colors.YELLOW)
solidRect(100, 100, Colors.GREEN)
solidRect(100, 100, Colors.RED)
solidRect(100, 100, Colors.BLUE)
}
} or: val sceneWidth = width
val sceneHeight = height
uiVerticalStack(sceneWidth, adjustSize = false) {
uiHorizontalStack(adjustHeight = true) {
solidRect(100, 100, Colors.BLUE)
solidRect(100, 100, Colors.RED)
solidRect(100, 100, Colors.GREEN)
solidRect(100, 100, Colors.YELLOW)
}
uiHorizontalStack(adjustHeight = true) {
solidRect(100, 100, Colors.YELLOW)
solidRect(100, 100, Colors.GREEN)
solidRect(100, 100, Colors.RED)
solidRect(100, 100, Colors.BLUE)
}
} depending on the effect you want to achieve. The problem was not that the image was smaller, but that the size of the boxes was kept, but the height used for the rows was 32, so the second row was overlapping it. You can check that by pressing F7 and going to those nodes. |
Maybe we could make the first argument (the size) nullable, and when the size is not provided, try to get the maxiumum size from their children |
For some reason the top row is shorter
The text was updated successfully, but these errors were encountered: