embiem/react-canvas-draw

Missing points when drawing

Closed this issue · 1 comments

Hi
I'm trying to use this library to draw on an image, and then take the points drawn and create a new canvas with the image on it (rather than using the image as a background)
However when I try to re-draw the points that I got from getSavedData() , I get spaced-out points

While Drawing:
Screen Shot 2020-06-10 at 9 50 28

After drawing the points on a new canvas:
Screen Shot 2020-06-10 at 9 50 41

My function for drawing:

 lines.forEach(({points, brushColor, brushRadius}) => {
            ctx.fillStyle = brushColor;
            points.forEach(({x, y}) => {
                ctx.fillRect(x, y, brushRadius, brushRadius);
            });
        });

Any ideas why?

switched to use lineTo()