Added comments, removed unused variables.

Signed-off-by: npalomba <nicola.palomba@studenti.galileilivorno.gov.it>
This commit is contained in:
npalomba
2019-04-01 21:37:53 +02:00
parent 8f4f4c2478
commit f7100ff9f7
6 changed files with 32 additions and 13 deletions

View File

@@ -9,9 +9,12 @@ function line(x0,y0,x1,y1) {
while (true) {
//set pixel
// If the current tool is the brush
if (currentTool == 'pencil') {
// I fill the rect
currentLayer.context.fillRect(x0-Math.floor(brushSize/2), y0-Math.floor(brushSize/2), brushSize, brushSize);
} else if (currentTool == 'eraser') {
// In case I'm using the eraser I must clear the rect
currentLayer.context.clearRect(x0-Math.floor(brushSize/2), y0-Math.floor(brushSize/2), eraserSize, eraserSize);
}