Skip to content
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

Use LayoutCoordinates.positionInWindow() instead of LayoutCoordinates.localToWindow(Offset.Zero) #923

Merged
merged 1 commit into from
Dec 6, 2023

Conversation

m-sasha
Copy link

@m-sasha m-sasha commented Dec 6, 2023

Just a tiny improvement: use an existing LayoutCoordinates.positionInWindow() function instead of reimplementing it inline.

Testing

Test: No testing

@m-sasha m-sasha merged commit cf8cb2a into jb-main Dec 6, 2023
1 check passed
@m-sasha m-sasha deleted the m-sasha/use-positionInWindow branch December 6, 2023 10:41
@@ -81,7 +82,7 @@ public fun <T : Component> SwingPanel(

Box(
modifier = modifier.onGloballyPositioned { coordinates ->
val location = coordinates.localToWindow(Offset.Zero).round()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's still not fully correct - it doesn't properly calculate the size. boundsInWindow should be used.
I already fixed in some time ago in #915 (and resolved conflicts after this PR)

mazunin-v-jb pushed a commit that referenced this pull request Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants