From 207c81e9dfb7575e5c6618f41ac658f6ef9c9c87 Mon Sep 17 00:00:00 2001 From: Orion Reed Date: Thu, 19 Dec 2024 02:36:35 -0500 Subject: [PATCH] cleanup transform --- lib/DOMTransform.ts | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/lib/DOMTransform.ts b/lib/DOMTransform.ts index 1bbffb9..e8a7caf 100644 --- a/lib/DOMTransform.ts +++ b/lib/DOMTransform.ts @@ -33,8 +33,6 @@ export class DOMTransform { this.#updateMatrices(); } - // Getters and setters for properties - get x(): number { return this.#x; } @@ -59,15 +57,6 @@ export class DOMTransform { this.#updateMatrices(); } - /** - * Updates the transformation matrices based on the current position and rotation. - */ - #updateMatrices() { - this.#transformMatrix.identity().translate(this.#x, this.#y).rotate(this.#rotation); - - this.#inverseMatrix = this.#transformMatrix.clone().invert(); - } - // Matrix accessors get matrix(): Matrix { return this.#transformMatrix; @@ -107,4 +96,13 @@ export class DOMTransform { rotation: this.rotation, }; } + + /** + * Updates the transformation matrices based on the current position and rotation. + */ + #updateMatrices() { + this.#transformMatrix.identity().translate(this.#x, this.#y).rotate(this.#rotation); + + this.#inverseMatrix = this.#transformMatrix.clone().invert(); + } }