Update
This commit is contained in:
@@ -77,6 +77,21 @@ export const generateTimelineFromTemplate = (dimensions, template, mediaStoreDat
|
||||
case 'caption':
|
||||
if (currentCaption) {
|
||||
processedElement.text = currentCaption;
|
||||
|
||||
// Calculate text width properties for better rendering consistency
|
||||
const textWidth = Math.min(dimensions.width * 0.8, 600); // Max 80% of canvas width or 600px
|
||||
processedElement.fixedWidth = textWidth;
|
||||
processedElement.offsetX = textWidth / 2; // Center alignment offset
|
||||
|
||||
// Ensure text is positioned properly (center horizontally)
|
||||
if (!processedElement.x || processedElement.x === 0) {
|
||||
processedElement.x = dimensions.width / 2; // Center horizontally
|
||||
}
|
||||
|
||||
// Ensure text has proper vertical positioning
|
||||
if (!processedElement.y || processedElement.y === 0) {
|
||||
processedElement.y = dimensions.height * 0.1; // 10% from top
|
||||
}
|
||||
} else {
|
||||
return null; // Skip if no caption
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user