```drawLine(
brush = SolidColor(Color.Red),
...

# composev

Vivek Sharma

01/04/2021, 6:17 AM 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

Val Salamakha

01/04/2021, 10:47 AM“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

Vivek Sharma

01/04/2021, 1:58 PMVivek Sharma

01/04/2021, 2:18 PMI got it, I considered graph be like centered from 0,0 like mathematics, okay Thank you