moko-resources
moko-resources copied to clipboard
Wrong size of images/icons in SVG format for desktop
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:
Android:
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