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

[wasm][js] Correct density rounding in ComposeWindow::resize #1268

Merged
merged 4 commits into from
Apr 12, 2024

Conversation

Schahen
Copy link
Collaborator

@Schahen Schahen commented Apr 12, 2024

The problems happen when the scaling is not an integer (say, 125%, 150% etc.) - we need to round only after we've resolved dimensions.

This supposedly fix issues we've encountered on Windows platform (see COMPOSE-1170 and in certain android phones)

@Schahen Schahen requested a review from eymar April 12, 2024 10:20

val width = boxSize.width * scaledDensity
val height = boxSize.height * scaledDensity
val width = (boxSize.width * scaledDensity).toInt()
Copy link
Member

Choose a reason for hiding this comment

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

why not roundToInt()?

Copy link
Member

@eymar eymar left a comment

Choose a reason for hiding this comment

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

Tested on my real Android device. Works as expected

@Schahen Schahen merged commit 4ae2a44 into jb-main Apr 12, 2024
5 of 6 checks passed
@Schahen Schahen deleted the shagen/correct-web-scaling branch April 12, 2024 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants