This commit is contained in:
ct
2025-07-15 01:52:48 +08:00
parent a12fe359d9
commit 593ea61576
3 changed files with 79 additions and 23 deletions

View File

@@ -224,11 +224,17 @@ const useVideoExport = ({ timelineElements, dimensions, totalDuration, watermark
opacity: WATERMARK_CONFIG.opacity,
align: 'center',
verticalAlign: 'middle',
offsetX: 90, // Approximate half-width to center the text
offsetY: 5, // Approximate half-height to center the text
});
layer.add(watermarkText);
// Force text measurement and update offset for proper centering
watermarkText._setTextData();
const textWidth = watermarkText.width();
const textHeight = watermarkText.height();
watermarkText.offsetX(textWidth / 2);
watermarkText.offsetY(textHeight / 2);
layer.draw();
const dataURL = stage.toDataURL({