@js-draw/math 1.10.0 → 1.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -44,12 +44,12 @@ class Triangle extends Abstract2DShape_1.default {
44
44
  }
45
45
  // Transform, treating this as composed of 2D points.
46
46
  transformed2DBy(affineTransform) {
47
- return this.map(affineTransform.transformVec2);
47
+ return this.map(vertex => affineTransform.transformVec2(vertex));
48
48
  }
49
49
  // Transforms this by a linear transform --- verticies are treated as
50
50
  // 3D points.
51
51
  transformedBy(linearTransform) {
52
- return this.map(linearTransform.transformVec3);
52
+ return this.map(vertex => linearTransform.transformVec3(vertex));
53
53
  }
54
54
  /**
55
55
  * Returns the sides of this triangle, as an array of `LineSegment2`s.
@@ -39,12 +39,12 @@ class Triangle extends Abstract2DShape {
39
39
  }
40
40
  // Transform, treating this as composed of 2D points.
41
41
  transformed2DBy(affineTransform) {
42
- return this.map(affineTransform.transformVec2);
42
+ return this.map(vertex => affineTransform.transformVec2(vertex));
43
43
  }
44
44
  // Transforms this by a linear transform --- verticies are treated as
45
45
  // 3D points.
46
46
  transformedBy(linearTransform) {
47
- return this.map(linearTransform.transformVec3);
47
+ return this.map(vertex => linearTransform.transformVec3(vertex));
48
48
  }
49
49
  /**
50
50
  * Returns the sides of this triangle, as an array of `LineSegment2`s.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@js-draw/math",
3
- "version": "1.10.0",
3
+ "version": "1.11.1",
4
4
  "description": "A math library for js-draw. ",
5
5
  "types": "./dist/mjs/lib.d.ts",
6
6
  "main": "./dist/cjs/lib.js",
@@ -28,7 +28,7 @@
28
28
  "bezier-js": "6.1.3"
29
29
  },
30
30
  "devDependencies": {
31
- "@js-draw/build-tool": "^1.7.0",
31
+ "@js-draw/build-tool": "^1.11.1",
32
32
  "@types/bezier-js": "4.1.0",
33
33
  "@types/jest": "29.5.5",
34
34
  "@types/jsdom": "21.1.3"
@@ -45,5 +45,5 @@
45
45
  "svg",
46
46
  "math"
47
47
  ],
48
- "gitHead": "ccf1d0634e902c731fcd794df11cd001c3a30585"
48
+ "gitHead": "695cfe01116839842668233a14fa858ad4ae0bac"
49
49
  }
@@ -41,13 +41,13 @@ export default class Triangle extends Abstract2DShape {
41
41
 
42
42
  // Transform, treating this as composed of 2D points.
43
43
  public transformed2DBy(affineTransform: Mat33) {
44
- return this.map(affineTransform.transformVec2);
44
+ return this.map(vertex => affineTransform.transformVec2(vertex));
45
45
  }
46
46
 
47
47
  // Transforms this by a linear transform --- verticies are treated as
48
48
  // 3D points.
49
49
  public transformedBy(linearTransform: Mat33) {
50
- return this.map(linearTransform.transformVec3);
50
+ return this.map(vertex => linearTransform.transformVec3(vertex));
51
51
  }
52
52
 
53
53
  #sides: TriangleBoundary|undefined = undefined;