Skip to content

Commit

Permalink
fix #5998
Browse files Browse the repository at this point in the history
  • Loading branch information
westnordost committed Nov 4, 2024
1 parent 296a533 commit 3f8d695
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import androidx.compose.ui.graphics.Outline
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.graphics.drawscope.Stroke
import androidx.compose.ui.graphics.vector.PathParser
import androidx.compose.ui.graphics.vector.toPath
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Density
Expand Down Expand Up @@ -79,11 +80,12 @@ private fun Modifier.levelLabelBackground() =
.padding(horizontal = 10.dp, vertical = 4.dp)

object AchievementFrameShape : Shape {
private val path = PathParser()
private val pathNodes = PathParser()
.parsePathString("m0.55404 0.97761c-0.029848 0.029846-0.078236 0.029846-0.10808 0l-0.42357-0.42357c-0.029848-0.029848-0.029848-0.078239 0-0.10808l0.42357-0.42357c0.029846-0.029846 0.078236-0.029846 0.10808 0l0.42357 0.42357c0.029846 0.029846 0.029846 0.078236 0 0.10808z")
.toPath()
.toNodes()

override fun createOutline(size: Size, layoutDirection: LayoutDirection, density: Density): Outline {
val path = pathNodes.toPath()
path.transform(Matrix().apply { scale(size.width, size.height, 1f) })
return Outline.Generic(path)
}
Expand Down

0 comments on commit 3f8d695

Please sign in to comment.