Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Attachment actions
Unintended behavior
View staffing
Description
Technical information:
Jetpack Compose version: bom 2024.09.00 and more specifically compose.ui 1.7.0-alpha08
Jetpack Compose component used: onGloballyPositioned
Android Studio Build: #AI-242.23339.11.2421.12483815
Kotlin version: 2.0.20
Description :
Since version 1.7.0-alpha08 of compose.ui we observe that the behavior of the LayoutCoordinate object returned to the onGlobalyPoisitioned method no longer works as before. Indeed, before this version, when we applied an X or Y rotation, the
LayoutCoordinator.windowToLocal()
andLayoutCoordinator.localToWindow()
methods were updated depending on the rotation. Since version 1.7.0-alpha08, rotating X or Y no longer has any impact on the values returned by these methods. Note that with a Z rotation, everything works correctly.Steps to Reproduce or Code Sample to Reproduce:
In the attached example project or in the attached video, we have isolated the behavior that is causing the problem.
In this example, we have 2 points: one green and one red.
localToWindow
to stay anchored to the blue frame when rotating.windowToLocal
to stay fixed outside the frame by calculating its position relative to the blue frame.As you can see on the version lower than 1.7.0-alpha08 the red dot and the green dot have the correct behavior. On the other hand, by just changing the version of compose.ui to 1.7.0-alpha08 then these two points no longer have the desired behavior and no longer seem to react to X and Y rotation whereas with a Z rotation everything is OK.
It also seems that version 1.7.0-alpha08 works as expected in API 28 and lower, and that the bug occurs from API 29 onwards.
The problem is still present in the latest version of BOM 2024.12.01
Can you help us fix this issue?