Run prettier

This commit is contained in:
2025-02-22 22:51:21 -08:00
parent 9d4a9bc0b1
commit 6ede822d4a
4 changed files with 21 additions and 12 deletions

View File

@ -165,14 +165,20 @@ export class Circle {
let rw = rect.size.w;
let rh = rect.size.h;
if (cx < rx) { testX = rx; }
else if (cx > rx + rw) { testX = rx + rw; }
if (cy < ry) { testY = ry; }
else if (cy > ry + rh) { testY = ry + rh; }
if (cx < rx) {
testX = rx;
} else if (cx > rx + rw) {
testX = rx + rw;
}
if (cy < ry) {
testY = ry;
} else if (cy > ry + rh) {
testY = ry + rh;
}
let distX = cx - testX;
let distY = cy - testY;
let sqDistance = (distX * distX) + (distY * distY);
let sqDistance = distX * distX + distY * distY;
if (sqDistance <= this.radius * this.radius) {
return new Point(testX, testY);
@ -183,7 +189,7 @@ export class Circle {
overlappedCells(size: Size): Rect[] {
let meAsRect = new Rect(
this.center.offset(new Point(-this.radius, -this.radius)),
new Size(this.radius * 2, this.radius * 2)
new Size(this.radius * 2, this.radius * 2),
);
let all: Rect[] = [];
for (let cell of meAsRect.overlappedCells(size).values()) {