@remotion/paths 4.0.38 → 4.0.39

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.
@@ -0,0 +1 @@
1
+ export declare const centerPath: (path: string) => string;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.centerPath = void 0;
4
+ const get_bounding_box_1 = require("./get-bounding-box");
5
+ const translate_path_1 = require("./translate-path");
6
+ const centerPath = (path) => {
7
+ const bBox = (0, get_bounding_box_1.getBoundingBox)(path);
8
+ const buttonWidth = bBox.x2 - bBox.x1;
9
+ const buttonHeight = bBox.y2 - bBox.y1;
10
+ const centeredButton = (0, translate_path_1.translatePath)(path, -buttonWidth / 2, -buttonHeight / 2);
11
+ return centeredButton;
12
+ };
13
+ exports.centerPath = centerPath;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/paths",
3
- "version": "4.0.38",
3
+ "version": "4.0.39",
4
4
  "description": "Utility functions for SVG paths",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,