CSS rule cleaning; fixed canvas clear issues; added rotation global
This commit is contained in:
@@ -4,8 +4,7 @@ const resetCanvasState = () => {
|
||||
clearCanvas();
|
||||
}
|
||||
|
||||
const resetRotation = () => { Painter.rotation = 0; }
|
||||
const clearCanvas = () => { Painter.canvasContext.clearRect(0, 0, canvas.width, canvas.height); }
|
||||
const resetRotation = () => { Painter.rotation = ROTATION; }
|
||||
|
||||
const resetCanvasBrush = () => {
|
||||
setDefaultBrushSize();
|
||||
@@ -13,6 +12,11 @@ const resetCanvasBrush = () => {
|
||||
setBrushToCenter();
|
||||
}
|
||||
|
||||
const clearCanvas = () => {
|
||||
Painter.canvasContext.clearRect(0, 0, canvas.width, canvas.height);
|
||||
Painter.canvasContext.beginPath();
|
||||
}
|
||||
|
||||
const setDefaultBrushSize = () => {
|
||||
Painter.brushSize = BRUSH_SIZE;
|
||||
Painter.canvasContext.lineWidth = BRUSH_SIZE;
|
||||
|
||||
Reference in New Issue
Block a user