```drawLine( brush = SolidColor(Color.Red), ...
# compose
v
Copy code
drawLine(
    brush = SolidColor(Color.Red),
    cap = StrokeCap.Round,
    strokeWidth = 8.dp.toPx(),
    start = middle,
    end = Offset(midX, 16.dp.toPx())
)
Can anyone help me with this, when we draw a line using the above code,
end
mean we ending that line at some position, But with
Offset(X,Y)
Y having
16.dp.toPx()
what does this mean? I am increasing Y offset like
100.dp.toPx()
, line is becoming short in length Why?
v
“I am increasing Y offset like 
100.dp.toPx()
 , line is becoming short in length Why?” The coordinate system of the Android canvas starts in the top left corner, where [0,0] represents that point. Your line joins two points between coordinates start(x,y) and end(x,y). So increasing Y you are reducing the line length as the start coordinates in the center of the Canvas.
v
@Val Salamakha start coordinate is in center, so line will be increasing from center, so why it is decreasing , how end(x,y) is related to start(x,y), they are just independent coordinates in Canvas
I got it, I considered graph be like centered from 0,0 like mathematics, okay Thank you