Update
This commit is contained in:
@@ -331,6 +331,22 @@ const VideoPreview = ({
|
||||
{watermarked && (
|
||||
<Text
|
||||
key={`watermark-${fontsLoaded}`}
|
||||
ref={(node) => {
|
||||
if (node && fontsLoaded) {
|
||||
// Force text measurement after font loading
|
||||
setTimeout(() => {
|
||||
node._setTextData();
|
||||
// Update offset to properly center the text
|
||||
const textWidth = node.width();
|
||||
const textHeight = node.height();
|
||||
node.offsetX(textWidth / 2);
|
||||
node.offsetY(textHeight / 2);
|
||||
if (layerRef.current) {
|
||||
layerRef.current.batchDraw();
|
||||
}
|
||||
}, 0);
|
||||
}
|
||||
}}
|
||||
text="memefa.st"
|
||||
x={dimensions.width / 2}
|
||||
y={dimensions.height / 2 + dimensions.height * 0.2}
|
||||
@@ -342,8 +358,6 @@ const VideoPreview = ({
|
||||
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
|
||||
draggable={false}
|
||||
listening={false} // Prevents any mouse interactions
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user