Skip to content

Commit f0be5b5

Browse files
committed
add Vector.ZERO and TransformMatrix.IDENTITY
1 parent 1aea873 commit f0be5b5

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

packages/2d/src/Models/TransformMatrix.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ export function createSVGMatrix(): DOMMatrix {
1414

1515
/** Represents a 2-dimensional transformation matrix. */
1616
export default class TransformMatrix {
17+
static IDENTITY = new TransformMatrix();
18+
1719
_matrix: DOMMatrix;
1820

1921
/** Create a TransformMatrix from a DOMMatrix of SVGMatrix. */

packages/2d/src/Models/Vector.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* A two-dimensional vector, used to represent points, sizes, and more.
55
*/
66
export default class Vector {
7+
static ZERO: ReadOnlyVector = new Vector(0, 0);
8+
79
x: number;
810
y: number;
911

0 commit comments

Comments
 (0)