This is an update to some outdated or different questions like:
I'd like to draw a line and at the end of this line there should some kind of a circle to generate a rounded line.
Because the round-lineend should be just at one side of the line I didn't use the line-cap property.
Using this code below on my computer works fine but testing this code with my iPhone... The line looks -lets say OK- to tbh the circle looks just like crap: Super blurry!
var c=document.getElementById("canvas");
var ctx=c.getContext("2d");
ctx.strokeStyle = "red"
ctx.beginPath();
ctx.moveTo(50,50);
ctx.lineWidth = 10;
ctx.lineTo(50,100);
ctx.stroke();
ctx.beginPath();
ctx.arc(50, 100, 0.001, 0, 2 * Math.PI, false);
ctx.lineWidth = 10;
ctx.strokeStyle = "green"
ctx.stroke();
<div style="position: absolute; margin-left: 25%;display: table; align-self: center; width: 100%;">
<canvas id="canvas"></canvas>
</div>
I couldn't find an working answer so far. But I would be super happy if somebody could fix my problem. Thanks in advance.