Skip to content

🎥 Make videos programmatically with React

More conservative approach to fillTextBox()

Jonny Burger4809d6efc4ec
diff --git a/packages/layout-utils/src/layouts/fill-text-box.ts b/packages/layout-utils/src/layouts/fill-text-box.ts
index dbc56b00c7..a07f611d93 100644
--- a/packages/layout-utils/src/layouts/fill-text-box.ts
+++ b/packages/layout-utils/src/layouts/fill-text-box.ts
@@ -46,7 +46,7 @@ export const fillTextBox = ({
const widths = lineWithWord.map((w) => measureText(w).width);
const lineWidthWithWordAdded = widths.reduce((a, b) => a + b, 0);
- if (lineWidthWithWordAdded <= maxBoxWidth) {
+ if (Math.ceil(lineWidthWithWordAdded) < maxBoxWidth) {
lines[currentlyAt].push({
text: lines[currentlyAt].length === 0 ? text.trimStart() : text,
fontFamily,