fix: zoom ruler click

This commit is contained in:
Hinnka committed 2026-03-15 15:21:00 +08:00
1 parent 3bc9b173cc
commit 98d3b1be92
1 file changed
+3 -3
@@ -142,9 +142,9 @@ fun ZoomRulerVertical(
.background(Color.Black.copy(alpha = 0.3f), RoundedCornerShape(16.dp))
.pointerInput(Unit) {
detectTapGestures { offset ->
val width = size.width
val stepWidth = width / stopsState.size
val index = (offset.x / stepWidth).toInt().coerceIn(0, stopsState.lastIndex)
val height = size.height
val stepHeight = height / stopsState.size
val index = (offset.y / stepHeight).toInt().coerceIn(0, stopsState.lastIndex)
onZoomChange(stopsState[index])
}
},