Kyant
12/06/2025, 2:41 AMGenericShape, click listener won't work after scroll to a certain position, which is a very urgent bug, and it has been there for a long time. Code is in🧵Kyant
12/06/2025, 2:42 AMColumn(
Modifier
.padding(16f.dp)
.verticalScroll(rememberScrollState(100000))
.fillMaxSize()
) {
Column(
Modifier
.fillMaxSize()
.clip(remember {
GenericShape { size, layoutDirection ->
addRect(size.toRect())
}
})
.background(Color.Cyan)
) {
repeat(1000) {
Text(
it.toString(),
Modifier
.clickable {}
.padding(160f.dp)
.fillMaxWidth()
)
}
}
}romainguy
12/06/2025, 6:56 AMromainguy
12/06/2025, 6:57 AMLouis Pullen-Freilich [G]
12/06/2025, 9:53 AMKyant
12/06/2025, 4:16 PMLouis Pullen-Freilich [G]
12/06/2025, 4:19 PMLouis Pullen-Freilich [G]
12/06/2025, 4:19 PMromainguy
12/06/2025, 7:23 PMromainguy
12/06/2025, 7:26 PMPathHitTester? This is basically a straight port to Kotlin of the Skia implementation, but you're still bound by float precisionLouis Pullen-Freilich [G]
12/06/2025, 7:52 PMLouis Pullen-Freilich [G]
12/06/2025, 7:54 PMLouis Pullen-Freilich [G]
12/06/2025, 7:57 PMromainguy
12/06/2025, 8:17 PMromainguy
12/06/2025, 8:18 PMromainguy
12/06/2025, 8:18 PMromainguy
12/06/2025, 8:18 PMLouis Pullen-Freilich [G]
12/06/2025, 11:12 PMLouis Pullen-Freilich [G]
12/16/2025, 6:02 PM@Test
fun test() {
val path =
Path().apply {
addRoundRect(
RoundRect(Rect(Offset.Zero, Size(2f, 2f)), cornerRadius = CornerRadius(1f, 1f))
)
// also same with below
// addOval(Rect(Offset.Zero, Size(2f, 2f)))
}
val hitTester = PathHitTester(path)
// true
assertTrue(Offset(0.1f, 1f) in hitTester)
// false
assertTrue(Offset(0.01f, 1f) in hitTester)
// false
assertTrue(Offset(0f, 1f) in hitTester)
}
Maybe my expectations are just wrong here 😅romainguy
12/16/2025, 6:05 PMromainguy
12/16/2025, 6:06 PMromainguy
12/16/2025, 6:07 PMLouis Pullen-Freilich [G]
12/16/2025, 6:07 PMLouis Pullen-Freilich [G]
12/16/2025, 6:08 PMsee the comment left in the implementationI missed this, let me have a look
Louis Pullen-Freilich [G]
12/16/2025, 6:08 PMromainguy
12/16/2025, 6:09 PMLouis Pullen-Freilich [G]
12/16/2025, 6:17 PMromainguy
12/16/2025, 6:18 PMLouis Pullen-Freilich [G]
12/16/2025, 6:19 PMromainguy
12/16/2025, 6:19 PMLouis Pullen-Freilich [G]
12/16/2025, 6:21 PMromainguy
12/16/2025, 6:21 PMromainguy
12/16/2025, 6:21 PMLouis Pullen-Freilich [G]
12/16/2025, 6:22 PMromainguy
12/16/2025, 6:22 PMromainguy
12/16/2025, 6:23 PMLouis Pullen-Freilich [G]
12/16/2025, 6:24 PMromainguy
12/16/2025, 6:28 PMromainguy
12/16/2025, 6:28 PMromainguy
12/16/2025, 6:28 PMLouis Pullen-Freilich [G]
12/16/2025, 6:30 PMLouis Pullen-Freilich [G]
12/16/2025, 6:30 PMromainguy
12/16/2025, 6:31 PMromainguy
12/16/2025, 6:31 PMLouis Pullen-Freilich [G]
12/16/2025, 6:34 PMLouis Pullen-Freilich [G]
12/16/2025, 6:34 PMromainguy
12/16/2025, 6:38 PMPathHitTester was built with multiple queries in mind, so it should be reasonably fast (I hope) and produce no allocationsromainguy
12/16/2025, 6:39 PMromainguy
12/16/2025, 6:39 PMLouis Pullen-Freilich [G]
12/16/2025, 6:49 PM