Questions tagged [jetpack-compose-drawscope]

3 questions
3
votes
1 answer

How to check which arc or pie chart segment clicked in Jetpack Compose?

This is a share your knowledge, Q&A-style question inspired by this question to detect which section of arc segment or degree of touch inside a circle or semi-circle as in gif and image below. Also how stroke width changes are set by default inwards…
2
votes
0 answers

why DrawScope dimensions don't match up with Canvas?

I want to draw on Canvas based on its layout dimension, but the dimensions received from DrawScope don't match with the Canvas @Preview @Composable fun Circle() { val modifier = Modifier .fillMaxSize() .border(1.dp, color =…
1
vote
0 answers

Jetpack Compose: DrawScope: Gradient alpha seems to be multiplied

I'm trying to create a ruler view entirely with draw commands. The ruler should be faded towards the edges. I can use a linear gradient for this, but the effect seems to be applied way to strongly In the code sample below, the colorStops and brush…