aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/Transform.ts
diff options
context:
space:
mode:
authorEleanor Eng <eleanor_eng@brown.edu>2019-04-08 17:54:30 -0400
committerEleanor Eng <eleanor_eng@brown.edu>2019-04-08 17:54:30 -0400
commit1327dc11149fc0ee774f6ee94609a4c48f901ef7 (patch)
tree4d1d5d04571fdb1d2408a606740909953c2789c1 /src/client/util/Transform.ts
parent52b30ce1ba6748c1d0a0f8697df3e66c53b2c315 (diff)
parent3a9f6df918ad45e55b0c6a540cb566aff4940288 (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into animationtimeline
Diffstat (limited to 'src/client/util/Transform.ts')
-rw-r--r--src/client/util/Transform.ts14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/client/util/Transform.ts b/src/client/util/Transform.ts
index 3e1039166..060c5da82 100644
--- a/src/client/util/Transform.ts
+++ b/src/client/util/Transform.ts
@@ -17,45 +17,45 @@ export class Transform {
this._scale = scale;
}
- translate = (x: number, y: number): Transform => {
+ translate = (x: number, y: number): this => {
this._translateX += x;
this._translateY += y;
return this;
}
- scale = (scale: number): Transform => {
+ scale = (scale: number): this => {
this._scale *= scale;
this._translateX *= scale;
this._translateY *= scale;
return this;
}
- scaleAbout = (scale: number, x: number, y: number): Transform => {
+ scaleAbout = (scale: number, x: number, y: number): this => {
this._translateX += x * this._scale - x * this._scale * scale;
this._translateY += y * this._scale - y * this._scale * scale;
this._scale *= scale;
return this;
}
- transform = (transform: Transform): Transform => {
+ transform = (transform: Transform): this => {
this._translateX = transform._translateX + transform._scale * this._translateX;
this._translateY = transform._translateY + transform._scale * this._translateY;
this._scale *= transform._scale;
return this;
}
- preTranslate = (x: number, y: number): Transform => {
+ preTranslate = (x: number, y: number): this => {
this._translateX += this._scale * x;
this._translateY += this._scale * y;
return this;
}
- preScale = (scale: number): Transform => {
+ preScale = (scale: number): this => {
this._scale *= scale;
return this;
}
- preTransform = (transform: Transform): Transform => {
+ preTransform = (transform: Transform): this => {
this._translateX += transform._translateX * this._scale;
this._translateY += transform._translateY * this._scale;
this._scale *= transform._scale;