moko-resources icon indicating copy to clipboard operation
moko-resources copied to clipboard

Wrong size of images/icons in SVG format for desktop

Open sawil314 opened this issue 2 years ago • 0 comments
trafficstars

Hi, When I paste an SVG as an Icon or Image, the icon/image is distorted on the Desktop. On Android, on the other hand, it looks as it should.

Desktop: desktopbutton Android: androidbutton Code:

fun ExampleButton(
    iconResource: ImageResource,
    onClick: () -> Unit,
) {
    Button(
        onClick,
        modifier = Modifier.size(width = 200.dp, height = 100.dp),
        colors = ButtonDefaults.buttonColors(containerColor = Color.Blue)
    ) {
        Icon(
            painterResource(iconResource),
            contentDescription = null,
            modifier = Modifier.size(48.dp)
        )
        Text(
            text ="Test",
            textAlign = TextAlign.Center,
            modifier = Modifier.align(Alignment.CenterVertically).fillMaxWidth()
        )
    }
}

The svg files is this one, but happens with other ones too: https://fontawesome.com/icons/cloud?f=classic&s=solid

sawil314 avatar Aug 15 '23 12:08 sawil314