korlibs / korlibs/korge

Rotating a scrollview makes children views' background disapear

Open
#418 0 comments 0 reactions 0 assignees View on GitHub
bug check
Dominant language
Kotlin
Stars
3k
Forks
148
Avg merge
13h 44m
Merged PRs (30d)
1

Description

Hi all,

I have tried to rotate a uiScrollable to change my menu Scene from landscape to portrait and I have shown that the buttons inside it where without background. Furthermore, the scrollview moves from being in the center, with full height size to being in middle of the screen.

Without Rotation:
![imagen](https://user-images.githubusercontent.com/7099995/151417881-c0108694-fba7-4375-b8e7-b968ae0af88b.png)

Rotating:
![imagen](https://user-images.githubusercontent.com/7099995/151417728-f06a6aa0-4c49-4690-9727-8467a0ff4827.png)

The code I used is the next one (menuButton is an override of UIButton, setting a custom uiSkin):

`
uiScrollable(config = {
size(buttonsWidth, views.virtualHeightDouble - 100.0)
centerOn(views.root)
// backgroundColor = RGBA(0, 0, 0, 0)
scrollBarAlpha = 0.0
overflowRate = 0.0
autohideScrollBar = true
rotation(Angle.fromDegrees(90))
})
{
for (i in 0 until sceneList.size) {
menuButton( buttonsWidth, buttonsHeight, sceneList[i].first) {
position(0, i * (buttonsHeight + 50).toInt())
onPress { sceneList[i].second() }
}
}
}º`

Thanks in advance.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue from the provided uiScrollable configuration, including rotation(Angle.fromDegrees(90)) and the custom menuButton uiSkin. Inspect the scrollable's rotation, sizing, and child rendering behavior while comparing the supplied screenshots; done means the children retain their backgrounds and the scrollview keeps its intended centered, full-height layout after rotation.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.