aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/Transform.ts
diff options
context:
space:
mode:
authorMonika Hedman <monika_hedman@brown.edu>2019-02-25 18:58:53 -0500
committerMonika Hedman <monika_hedman@brown.edu>2019-02-25 18:58:53 -0500
commit293532a50a5670d2cd04fed65df77173e2dbad67 (patch)
tree7a437e6b39cc4602cecee8503125412c4a6849b2 /src/client/util/Transform.ts
parent921941e3f9bc4981f92fbf0fe0cec948cd49c220 (diff)
parent292ff1a8d75f8b15f9388d2c577e09a13836d5dc (diff)
merging
Diffstat (limited to 'src/client/util/Transform.ts')
-rw-r--r--src/client/util/Transform.ts6
1 files changed, 6 insertions, 0 deletions
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)
}