Skip to content

Commit 0fe2f2a

Browse files
committed
fix: apply opacity fallback to dash circle stroke-opacity
1 parent bd457b3 commit 0fe2f2a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

samples/ShieldSolid.svg.nonoptimized.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ val ShieldSolidSvgNonOptimized: ImageVector
3030
// M256 0 c4.6 0 9.2 1 13.4 2.9 L457.7 82.8 c22 9.3 38.4 31 38.3 57.2 c-.5 99.2 -41.3 280.7 -213.6 363.2 c-16.7 8 -36.1 8 -52.8 0 C57.3 420.7 16.5 239.2 16 140 c-.1 -26.2 16.3 -47.9 38.3 -57.2 L242.7 2.9 C246.8 1 251.4 0 256 0z m0 66.8 V444.8 C394 378 431.1 230.1 432 141.4 L256 66.8 l0 0z
3131
path(
3232
fill = SolidColor(Color(0xFF1E3050)),
33+
fillAlpha = 1.0f,
34+
strokeAlpha = 1.0f,
3335
) {
3436
// M 256 0
3537
moveTo(x = 256.0f, y = 0.0f)

svg-to-compose/src/commonMain/kotlin/dev/tonholo/s2c/domain/svg/SvgCircleNode.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ private fun SvgCircleNode.createDashedCircle(minified: Boolean): ImageVectorNode
186186
// as the dash is a path now, all the stroke parameters
187187
// are used inside the fill parameters instead.
188188
fill = strokeBrush(dashedCircleNodes),
189-
fillAlpha = strokeOpacity,
189+
fillAlpha = strokeOpacity ?: opacity,
190190
),
191191
wrapper = ImageVectorNode.NodeWrapper(
192192
normalizedPath = buildNormalizedPath(),

0 commit comments

Comments
 (0)