From 74592676444cdb9bdc2fef5dc8c483667b557a5e Mon Sep 17 00:00:00 2001 From: Josh Kingsley Date: Sun, 26 Oct 2025 22:13:31 +0200 Subject: feat(web): draw cell values --- web/src/math/Rect.ts | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'web/src/math') diff --git a/web/src/math/Rect.ts b/web/src/math/Rect.ts index e26fbae..f52a2f7 100644 --- a/web/src/math/Rect.ts +++ b/web/src/math/Rect.ts @@ -40,6 +40,13 @@ export default class Rect { ); } + get center(): Coord { + return new Coord( + this.topLeft.x + (this.bottomRight.x - this.topLeft.x) / 2, + this.topLeft.y + (this.bottomRight.y - this.topLeft.y) / 2, + ); + } + /** Determine if this rectangle contains the point at `coord`. */ containsCoord(coord: Coord): boolean { return ( -- cgit v1.2.3