Fix icon scaling
This commit is contained in:
parent
0ecc9420c0
commit
875043c214
@ -19,6 +19,7 @@ import androidx.compose.foundation.gestures.detectTapGestures
|
|||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.foundation.layout.requiredSize
|
||||||
import androidx.compose.foundation.layout.size
|
import androidx.compose.foundation.layout.size
|
||||||
import androidx.compose.foundation.shape.CircleShape
|
import androidx.compose.foundation.shape.CircleShape
|
||||||
import androidx.compose.foundation.shape.GenericShape
|
import androidx.compose.foundation.shape.GenericShape
|
||||||
@ -165,7 +166,7 @@ fun ShapedLauncherIcon(
|
|||||||
if (bmp != null && ic != null) {
|
if (bmp != null && ic != null) {
|
||||||
Canvas(
|
Canvas(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.size(defaultIconSize)
|
.requiredSize(defaultIconSize)
|
||||||
.scale(size / defaultIconSize, TransformOrigin.Center)
|
.scale(size / defaultIconSize, TransformOrigin.Center)
|
||||||
) {
|
) {
|
||||||
val brush = BitmapShaderBrush(bmp)
|
val brush = BitmapShaderBrush(bmp)
|
||||||
@ -230,8 +231,7 @@ fun ShapedLauncherIcon(
|
|||||||
val color = MaterialTheme.colorScheme.secondaryContainer
|
val color = MaterialTheme.colorScheme.secondaryContainer
|
||||||
Canvas(
|
Canvas(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.size(defaultIconSize)
|
.fillMaxSize()
|
||||||
.scale(size / defaultIconSize, TransformOrigin.Center)
|
|
||||||
) {
|
) {
|
||||||
val outline =
|
val outline =
|
||||||
shape.createOutline(this.size, layoutDirection, Density(density, fontScale))
|
shape.createOutline(this.size, layoutDirection, Density(density, fontScale))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user