我正在尝试使用 Jetpack Compose 版本 1.5.4 绘制比例。到目前为止一切顺利,但当我尝试绘制权重指示器时,我的问题就出现了,感觉它有某种锯齿。
如您所见,它应该是一个光滑的三角形。这里出了什么问题?
针对该特定指标,我的代码如下:
drawPath(
path = Path().apply {
reset()
arcTo(
rect = Rect(
center = scaleCenter,
radius = innerRadius
),
startAngleDegrees = 269.5f,
sweepAngleDegrees = 1f,
forceMoveTo = false
)
lineTo(
x = scaleCenter.x + innerRadius * cos((3 * PI.toFloat()) / 2),
y = scaleCenter.y + innerRadius * sin((3 * PI.toFloat()) / 2) - style.scaleIndicatorLength.toPx()
)
close()
},
color = style.scaleIndicatorColor
)