ch((point,index)=>{
if(index===0)ctx.moveTo(point.x,point.y);
else ctx.lineTo(point.x,point.y);
});
if(currentSelection.length>1){
ctx.lineTo(currentSelection[0].x,currentSelection[0].y);
}
ctx.stroke();
}
function completePolygonSelection(){
maskCtx.fillStyle=colorPicker.value;
maskCtx.beginPath();
currentSelection.forEach((point,index)=>{
if(index===0)maskCtx.moveTo(point.x,point.y);
else maskCtx.lineTo(point.x,point.y);
});
maskCtx.closePath();
maskCtx.fill();
currentSelection=[];
drawImage();
setStatus(