@remotion/shapes 4.0.142 → 4.0.144

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.
package/bunfig.toml ADDED
@@ -0,0 +1,2 @@
1
+ [test]
2
+ preload = "./happydom.ts"
@@ -35,10 +35,13 @@ const makePolygon = ({ points, radius, cornerRadius = 0, edgeRoundness = null, }
35
35
  cornerRadius,
36
36
  edgeRoundness,
37
37
  });
38
+ const reduced = (0, paths_1.reduceInstructions)(polygonPathInstructions);
39
+ const path = (0, paths_1.resetPath)((0, paths_1.serializeInstructions)(reduced));
40
+ const boundingBox = paths_1.PathInternals.getBoundingBoxFromInstructions(reduced);
38
41
  return {
39
- path: (0, paths_1.serializeInstructions)(polygonPathInstructions),
40
- width,
41
- height,
42
+ path,
43
+ width: boundingBox.width,
44
+ height: boundingBox.height,
42
45
  transformOrigin: `${centerX} ${centerY}`,
43
46
  instructions: polygonPathInstructions,
44
47
  };
@@ -47,10 +47,13 @@ const makeStar = ({ points, innerRadius, outerRadius, cornerRadius = 0, edgeRoun
47
47
  cornerRadius,
48
48
  edgeRoundness,
49
49
  });
50
+ const reduced = (0, paths_1.reduceInstructions)(starPathInstructions);
51
+ const path = (0, paths_1.resetPath)((0, paths_1.serializeInstructions)(reduced));
52
+ const boundingBox = paths_1.PathInternals.getBoundingBoxFromInstructions(reduced);
50
53
  return {
51
- path: (0, paths_1.resetPath)((0, paths_1.serializeInstructions)(starPathInstructions)),
52
- width,
53
- height,
54
+ path,
55
+ width: boundingBox.width,
56
+ height: boundingBox.height,
54
57
  transformOrigin: `${centerX} ${centerY}`,
55
58
  instructions: starPathInstructions,
56
59
  };
package/happydom.ts ADDED
@@ -0,0 +1,3 @@
1
+ import {GlobalRegistrator} from '@happy-dom/global-registrator';
2
+
3
+ GlobalRegistrator.register();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/shapes",
3
- "version": "4.0.142",
3
+ "version": "4.0.144",
4
4
  "description": "Utility functions and components for SVG shapes",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -38,7 +38,7 @@
38
38
  "react-dom": ">=16.8.0"
39
39
  },
40
40
  "dependencies": {
41
- "@remotion/paths": "4.0.142"
41
+ "@remotion/paths": "4.0.144"
42
42
  },
43
43
  "scripts": {
44
44
  "formatting": "prettier src --check",