MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / restoreCanvas

Function restoreCanvas

assets/js/draw.js:96–110  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

94
95// Draw what is stored in DrawnArray
96function restoreCanvas() {
97 for (let i = 1; i < drawnArray.length; i++) {
98 context.beginPath();
99 context.moveTo(drawnArray[i - 1].x, drawnArray[i - 1].y);
100 context.lineWidth = drawnArray[i].size;
101 context.lineCap = 'round';
102 if (drawnArray[i].eraser) {
103 context.strokeStyle = bucketColor;
104 } else {
105 context.strokeStyle = drawnArray[i].color;
106 }
107 context.lineTo(drawnArray[i].x, drawnArray[i].y);
108 context.stroke();
109 }
110}
111
112// Store Drawn Lines in DrawnArray
113function storeDrawn(x, y, size, color, erase) {

Callers 1

draw.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected