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

Fix SVGLength.withUnit #804

Merged
merged 1 commit into from
Sep 27, 2023
Merged

Fix SVGLength.withUnit #804

merged 1 commit into from
Sep 27, 2023

Conversation

eymar
Copy link
Member

@eymar eymar commented Sep 27, 2023

create a new SVGLength with a _unit from the input and not this.unit


It seems that this typo didn't cause any real issue so far.
The only it was used in compose is here: https://github.com/JetBrains/compose-multiplatform-core/blob/bcaacc85477f959cac171b60258679b6244f512b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/res/DesktopSvgResources.desktop.kt#L66

val width = root?.width?.withUnit(SVGLengthUnit.PX)?.value ?: 0f
val height = root?.height?.withUnit(SVGLengthUnit.PX)?.value ?: 0f

But here withUnit does nothing really useful, since withUnit doesn't do any conversion of the value - it preserves the original value .

@eymar eymar requested a review from igordmn September 27, 2023 09:49
@eymar
Copy link
Member Author

eymar commented Sep 27, 2023

Mering it now. The failing CI/ios is attempted to be fixed separately here - #805

@eymar eymar merged commit d9ab6e5 into master Sep 27, 2023
@eymar eymar deleted the fix_svg_length_witUnit branch September 27, 2023 12: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.

2 participants