summaryrefslogtreecommitdiff
path: root/apps/web/src/components/editor/preview-panel.tsx
diff options
context:
space:
mode:
authorMaze Winther <mazewinther@gmail.com>2025-08-11 22:24:54 +0200
committerMaze Winther <mazewinther@gmail.com>2025-08-11 22:24:54 +0200
commit5b059ce6deb2b4132b445a0db3816388367acccf (patch)
tree9650dcb1efe10b15650aa3b4e152854bbaae0b2d /apps/web/src/components/editor/preview-panel.tsx
parent38f82767884250fe7c9e99672d06cb59ac957cd0 (diff)
downloadopencut-5b059ce6deb2b4132b445a0db3816388367acccf.tar.gz
feat: auto-captions
Diffstat (limited to 'apps/web/src/components/editor/preview-panel.tsx')
-rw-r--r--apps/web/src/components/editor/preview-panel.tsx12
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/web/src/components/editor/preview-panel.tsx b/apps/web/src/components/editor/preview-panel.tsx
index a47e446a..785162a6 100644
--- a/apps/web/src/components/editor/preview-panel.tsx
+++ b/apps/web/src/components/editor/preview-panel.tsx
@@ -356,7 +356,7 @@ export function PreviewPanel() {
return (
<div
key={element.id}
- className="absolute flex items-center justify-center cursor-grab"
+ className="absolute cursor-grab"
onMouseDown={(e) =>
handleTextMouseDown(e, element, elementData.track.id)
}
@@ -377,7 +377,7 @@ export function PreviewPanel() {
canvasSize.height) *
100
}%`,
- transform: `translate(-50%, -50%) rotate(${element.rotation}deg) scale(${scaleRatio})`,
+ transform: `translate(-50%, -50%) rotate(${element.rotation}deg)`,
opacity: element.opacity,
zIndex: 100 + index, // Text elements on top
}}
@@ -385,16 +385,16 @@ export function PreviewPanel() {
<div
className={fontClassName}
style={{
- fontSize: `${element.fontSize}px`,
+ fontSize: `${element.fontSize * scaleRatio}px`,
color: element.color,
backgroundColor: element.backgroundColor,
textAlign: element.textAlign,
fontWeight: element.fontWeight,
fontStyle: element.fontStyle,
textDecoration: element.textDecoration,
- padding: "4px 8px",
- borderRadius: "2px",
- whiteSpace: "pre-wrap",
+ padding: `${4 * scaleRatio}px ${8 * scaleRatio}px`,
+ borderRadius: `${2 * scaleRatio}px`,
+ whiteSpace: "nowrap",
// Fallback for system fonts that don't have classes
...(fontClassName === "" && { fontFamily: element.fontFamily }),
}}