How could I draw a texture between the bottom of the canvas and below the green line, in javascript? I dynamically add coordinates in a canvas, then draw lines between these points.
EDIT : Solution: so I had to do it like this :
let path = 'M'+points[i-1].x+' '+points[i-1].y;
path += 'L'+points[i].x+' '+points[i].y;
//etc... with "Z" for closing the path, then :
let p = new Path2D(path);
ctx.fillStyle = ctx.createPattern(imgTexture, "repeat");
ctx.fill(p);