Following the <youtube video> `Introduction to dra...
# compose
l
Following the

youtube video

Introduction to drawing in Compose
I implemented in my app a graph of elevation gain / loss for trails. It's working really great except when I have a lot of points (in my screenshots example it's 1998 points). Angle between points are rectangular instead of being smooth like it should with a Bezier. Any idea what could be the issue? 🤔
If I reduce the amount of points (for example if
previousPoint.altitude == currentPoint.altitude
, I don't add the current point to the list) it's way better. I though that with quadratic curves it's impossible to have rectangular angles
image.png
s
It is likely that you have more points that pixels on screen at this point, so start and end point are the same (or 1px away), making it impossible to smooth out. Consider sampling min/max or average over number of points instead to reduce the amount 🙂
l
Ok thanks, that makes sense!
Just out of curiosity, what is causing this limitation? On iOS they are able to smooth the graph with this number of points. Is it the rendering engine of Android? 🤔
s
It's likely just a stroke cap parameter or something similar
Not quite sure, tbh