Skip to content

Commit 0baebd8

Browse files
Kyant0YuKongA
authored andcommitted
library: Update default CornerSmoothness
1 parent 251b599 commit 0baebd8

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/utils/G2RoundedCornerShape.kt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import androidx.compose.ui.unit.dp
2727
import androidx.compose.ui.util.fastCoerceAtMost
2828
import androidx.compose.ui.util.fastCoerceIn
2929
import kotlin.math.PI
30-
import kotlin.math.asin
3130
import kotlin.math.cos
3231
import kotlin.math.min
3332
import kotlin.math.sin
@@ -275,9 +274,9 @@ data class CornerSmoothness(
275274

276275
private val sin = sin(bezierRadians)
277276
private val cos = cos(bezierRadians)
278-
private val a = 1f - sin / (1f + cos) // 2/3 at arcsin(0.6)
277+
private val a = 1f - sin / (1f + cos)
279278
private val d = 1.5f * sin / (1f + cos) / (1f + cos)
280-
private val ad = a + d // minimum 17/18 at arcsin(0.6)
279+
private val ad = a + d
281280

282281
private fun Path.topRightCorner0(size: Size, r: Float, dy: Float) {
283282
val w = size.width
@@ -593,9 +592,8 @@ data class CornerSmoothness(
593592
@Stable
594593
val Default: CornerSmoothness =
595594
CornerSmoothness(
596-
// ~= 16.26 deg, bezierRadians = arcsin(0.6)
597-
circleFraction = 1f - 2f * asin(0.6f) / HalfPI,
598-
extendedFraction = 0.75f
595+
circleFraction = 0.2f,
596+
extendedFraction = 1f
599597
)
600598

601599
@Stable

0 commit comments

Comments
 (0)