0

please tel me the below continuous path problem i want to draw another path like rectangle etc..

        flag = true;
        dot_flag = true;
        if (dot_flag){


            ctx.beginPath();
            ctx.fillStyle = x;
            ctx.moveTo(prevX, prevY);
            ctx.lineTo(currX, currY);
            ctx.fill();
            ctx.stroke();
            ctx.closePath();
            ctx.moveTo(prevX,prevY);
            ctx.lineWidth = y;              
            //ctx.stroke();     

            ctx.fillRect(currX, currY, 2, 2);
            ctx.closePath();
            dot_flag = false; 
            ctx.traslate(prevX,prevY);

        }
    }

0 Answers0