I am trying to draw a shape using canvas and I am pretty close from what I want. Just the round corners are a bit hard to achieve what I need.
I have the following code
var canvas = $("#myCanvas");
var context = canvas.get(0).getContext("2d");
// Set rectangle and corner values
var cornerRadius = 5;
// Set faux rounded corners
context.lineJoin = "round";
context.lineWidth = 50;
context.beginPath();
context.moveTo(400, 60);
context.lineTo(360, 140);
context.lineTo(240, 135);
context.lineTo(180, 60);
context.closePath();
context.stroke();
context.fill();
which result in this shape here
What I am trying to achieve is having both left and right bottom corners rounded but not the top ones.
If I remove the lineJoin, then the rounded corners are gone.
So, how can I set the points where the lineJoin should run ?
Many thanks.