compose-multiplatform icon indicating copy to clipboard operation
compose-multiplatform copied to clipboard

Resizing window leads to corrupted rendering when using svgResource

Open ypujante opened this issue 4 years ago • 4 comments

The following code

    Column(horizontalAlignment = Alignment.CenterHorizontally, modifier = Modifier.fillMaxWidth()) {
        Image(
            painter = svgResource("images/Kotlin-logo.svg"),
            contentDescription = "Logo",
            modifier = Modifier.fillMaxWidth().padding(5.dp),
        )
    }

leads to corrupted rendering when resizing (shrinking) the window as can be seen in this picture

Screen Shot 2021-03-06 at 10 04 50

I am attaching the svg file used

Kotlin-logo.svg.zip

Please note that if you remove the width/height parameters then the problem goes away

// rendering issue
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
x="0px" y="0px" viewBox="0 0 60 60" style="enable-background:new 0 0 60 60;" 
width="512" height="512" xml:space="preserve">

// no rendering issue
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
x="0px" y="0px" viewBox="0 0 60 60" style="enable-background:new 0 0 60 60;" 
xml:space="preserve">

ypujante avatar Mar 06 '21 18:03 ypujante

Thanks for the report!

The corrupted rendering happens on macOs, but don't happen on WIndows.

Probably it is a bug in Skia. We will make a reproducer in pure Skia and fill an issue in Skia issue tracker.

igordmn avatar Mar 12 '21 13:03 igordmn

@igordmn is Skia issue number known?

olonho avatar Mar 15 '21 06:03 olonho

is Skia issue number known?

No, I didn't find existing issue. We need to create a new one with a reproducer.

igordmn avatar Mar 15 '21 08:03 igordmn

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

okushnikov avatar Aug 26 '24 17:08 okushnikov