Merge "[CircularProgressIndicator] Fix gapSize not scaling with diameter" into androidx-main
diff --git a/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/ProgressIndicatorScreenshotTest.kt b/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/ProgressIndicatorScreenshotTest.kt
index 6a6af69..9bb7c63 100644
--- a/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/ProgressIndicatorScreenshotTest.kt
+++ b/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/ProgressIndicatorScreenshotTest.kt
@@ -182,6 +182,19 @@
     }
 
     @Test
+    fun circularProgressIndicator_lightTheme_determinate_size() {
+        rule.setMaterialContent(lightColorScheme()) {
+            Box(wrap.testTag(wrapperTestTag)) {
+                CircularProgressIndicator(
+                    modifier = Modifier.size(88.dp),
+                    progress = { 0.5f }
+                )
+            }
+        }
+        assertIndicatorAgainstGolden("circularProgressIndicator_lightTheme_determinate_size")
+    }
+
+    @Test
     fun circularProgressIndicator_lightTheme_indeterminate() {
         rule.mainClock.autoAdvance = false
         rule.setMaterialContent(lightColorScheme()) {
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/ProgressIndicator.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/ProgressIndicator.kt
index 9381e45..d193764 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/ProgressIndicator.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/ProgressIndicator.kt
@@ -581,7 +581,7 @@
             gapSize + strokeWidth
         }
         val gapSizeSweep =
-            (adjustedGapSize.value / (Math.PI * CircularIndicatorDiameter.value).toFloat()) * 360f
+            (adjustedGapSize.value / (Math.PI * size.width.toDp().value).toFloat()) * 360f
 
         drawCircularIndicator(
             startAngle + sweep + min(sweep, gapSizeSweep),