Fixed ellipse bug, fixed brush size bug

This commit is contained in:
Nicola
2022-01-30 22:53:59 +01:00
parent edf5d77ffd
commit 79a3c07b82
3 changed files with 13 additions and 8 deletions

View File

@ -161,7 +161,7 @@ class EllipseTool extends ResizableTool {
for (const coord in toFill) {
let arrayCoord = JSON.parse("[" + coord + "]");
if (arrayCoord[0]-xc > 0 || arrayCoord[1]-yc < 0) {
if (arrayCoord[0]-xc < 0 || arrayCoord[1]-yc < 0) {
continue;
}
@ -180,9 +180,9 @@ class EllipseTool extends ResizableTool {
!removed[[arrayCoord[0], arrayCoord[1] + 1]] && !removed[arrayCoord[0] + 1, arrayCoord[1]])) ||
removed[arrayCoord]) {
context.fillRect(arrayCoord[0], arrayCoord[1], this.currSize, this.currSize);
context.fillRect(xc + Math.abs(xc - arrayCoord[0]), arrayCoord[1], this.currSize, this.currSize);
context.fillRect(xc - Math.abs(xc - arrayCoord[0]), arrayCoord[1], this.currSize, this.currSize);
context.fillRect(arrayCoord[0], yc - Math.abs(yc - arrayCoord[1]), this.currSize, this.currSize);
context.fillRect(xc + Math.abs(xc - arrayCoord[0]), yc - Math.abs(yc - arrayCoord[1]), this.currSize, this.currSize);
context.fillRect(xc - Math.abs(xc - arrayCoord[0]), yc - Math.abs(yc - arrayCoord[1]), this.currSize, this.currSize);
}
removed[arrayCoord] = true;