From cb56876b21dc47f26747f902bd81df49eae4cf4b Mon Sep 17 00:00:00 2001 From: Tyler Schicke Date: Sun, 24 Feb 2019 22:48:29 -0500 Subject: Small changes --- src/client/util/Transform.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/client/util/Transform.ts') diff --git a/src/client/util/Transform.ts b/src/client/util/Transform.ts index 9fd4f7bef..3e1039166 100644 --- a/src/client/util/Transform.ts +++ b/src/client/util/Transform.ts @@ -102,6 +102,12 @@ export class Transform { return [x * this._scale, y * this._scale]; } + transformBounds(x: number, y: number, width: number, height: number): { x: number, y: number, width: number, height: number } { + [x, y] = this.transformPoint(x, y); + [width, height] = this.transformDirection(width, height); + return { x, y, width, height }; + } + inverse = () => { return new Transform(-this._translateX / this._scale, -this._translateY / this._scale, 1 / this._scale) } -- cgit v1.2.3-70-g09d2