diff options
author | Tyler Schicke <tyler_schicke@brown.edu> | 2019-04-08 18:31:32 -0400 |
---|---|---|
committer | Tyler Schicke <tyler_schicke@brown.edu> | 2019-04-08 18:31:32 -0400 |
commit | 3925f2ca6f313ba3ced747f05c4ab69a323755a7 (patch) | |
tree | 8d5837f5300f8d92d6d2a80d357e880a048a173f /src/client/util/Transform.ts | |
parent | b6eae4662c8422f269a4e2ec810e0e94a4b5089d (diff) | |
parent | 3a9f6df918ad45e55b0c6a540cb566aff4940288 (diff) |
Merge branch 'master' of github-tsch-brown:browngraphicslab/Dash-Web into propsRefactor
Diffstat (limited to 'src/client/util/Transform.ts')
-rw-r--r-- | src/client/util/Transform.ts | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/client/util/Transform.ts b/src/client/util/Transform.ts index 54effd512..ed4282874 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; |