@shotstack/shotstack-canvas 1.6.1 → 1.6.2
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/dist/entry.node.cjs +6 -2
- package/dist/entry.node.js +6 -2
- package/package.json +1 -1
package/dist/entry.node.cjs
CHANGED
|
@@ -2604,9 +2604,13 @@ async function createTextEngine(opts = {}) {
|
|
|
2604
2604
|
console.log(
|
|
2605
2605
|
`\u{1F3A8} Video settings: Animation=${hasAnimation}, Background=${hasBackground}, BorderRadius=${hasBorderRadius}, Alpha=${needsAlpha}`
|
|
2606
2606
|
);
|
|
2607
|
+
const padding = asset.padding ? typeof asset.padding === "number" ? { left: asset.padding, right: asset.padding, top: asset.padding, bottom: asset.padding } : asset.padding : { left: 0, right: 0, top: 0, bottom: 0 };
|
|
2608
|
+
const borderWidth = asset.border?.width ?? 0;
|
|
2609
|
+
const canvasWidth = (asset.width ?? width) + padding.left + padding.right + borderWidth * 2;
|
|
2610
|
+
const canvasHeight = (asset.height ?? height) + padding.top + padding.bottom + borderWidth * 2;
|
|
2607
2611
|
const finalOptions = {
|
|
2608
|
-
width:
|
|
2609
|
-
height:
|
|
2612
|
+
width: canvasWidth,
|
|
2613
|
+
height: canvasHeight,
|
|
2610
2614
|
fps,
|
|
2611
2615
|
duration: options.duration ?? 3,
|
|
2612
2616
|
outputPath: options.outputPath ?? "output.mp4",
|
package/dist/entry.node.js
CHANGED
|
@@ -2565,9 +2565,13 @@ async function createTextEngine(opts = {}) {
|
|
|
2565
2565
|
console.log(
|
|
2566
2566
|
`\u{1F3A8} Video settings: Animation=${hasAnimation}, Background=${hasBackground}, BorderRadius=${hasBorderRadius}, Alpha=${needsAlpha}`
|
|
2567
2567
|
);
|
|
2568
|
+
const padding = asset.padding ? typeof asset.padding === "number" ? { left: asset.padding, right: asset.padding, top: asset.padding, bottom: asset.padding } : asset.padding : { left: 0, right: 0, top: 0, bottom: 0 };
|
|
2569
|
+
const borderWidth = asset.border?.width ?? 0;
|
|
2570
|
+
const canvasWidth = (asset.width ?? width) + padding.left + padding.right + borderWidth * 2;
|
|
2571
|
+
const canvasHeight = (asset.height ?? height) + padding.top + padding.bottom + borderWidth * 2;
|
|
2568
2572
|
const finalOptions = {
|
|
2569
|
-
width:
|
|
2570
|
-
height:
|
|
2573
|
+
width: canvasWidth,
|
|
2574
|
+
height: canvasHeight,
|
|
2571
2575
|
fps,
|
|
2572
2576
|
duration: options.duration ?? 3,
|
|
2573
2577
|
outputPath: options.outputPath ?? "output.mp4",
|
package/package.json
CHANGED