Can somebody help me understand how does path.lineTo(x,y) actually work. I am trying to draw a simple straight line in a finger paint type of app. Here is an example I tried:
mPath.reset();
mPath.moveTo(0, 0);
mPath.lineTo(480, 800);
But the line goes only from 0,0 to 240, 400 – always only a half of distance as I move my finger over the screen. (the real programme has startX, startY and x,y touch coordinates instead of 0,0 & 480,800)
Thanks to Goz and others who helped me truobleshoot this, it came out that Paint was doing it with this settings:
When this is removed or set to null, lineTo goes all the way. One just did not expect at first that Paint would do this but this corner rounding effect can shorten a straight line.