summaryrefslogtreecommitdiff
path: root/apps/web/src/components/editor/preview-panel.tsx
diff options
context:
space:
mode:
authorVlad <vlad.palacio@gmail.com>2025-07-29 22:23:34 -0400
committerVlad <vlad.palacio@gmail.com>2025-07-29 22:23:34 -0400
commitda0e768b327261ed2e63ac912d8410dd6a1ac1b5 (patch)
treee8f50413e549bef04dc0696ae09e5cbd169400e3 /apps/web/src/components/editor/preview-panel.tsx
parentdeda0e366fc934f9734d4c523e46fa8b51111237 (diff)
downloadopencut-da0e768b327261ed2e63ac912d8410dd6a1ac1b5.tar.gz
[BUG] UI: Inactive click area on the Timeline
-Made the clickable area larger by increasing the container height -Fixed lint errors.
Diffstat (limited to 'apps/web/src/components/editor/preview-panel.tsx')
-rw-r--r--apps/web/src/components/editor/preview-panel.tsx22
1 files changed, 19 insertions, 3 deletions
diff --git a/apps/web/src/components/editor/preview-panel.tsx b/apps/web/src/components/editor/preview-panel.tsx
index 639858d0..6cb06061 100644
--- a/apps/web/src/components/editor/preview-panel.tsx
+++ b/apps/web/src/components/editor/preview-panel.tsx
@@ -211,7 +211,7 @@ export function PreviewPanel() {
setDragState({
isDragging: true,
elementId: element.id,
- trackId: trackId,
+ trackId,
startX: e.clientX,
startY: e.clientY,
initialElementX: element.x,
@@ -355,8 +355,24 @@ export function PreviewPanel() {
handleTextMouseDown(e, element, elementData.track.id)
}
style={{
- left: `${50 + ((dragState.isDragging && dragState.elementId === element.id ? dragState.currentX : element.x) / canvasSize.width) * 100}%`,
- top: `${50 + ((dragState.isDragging && dragState.elementId === element.id ? dragState.currentY : element.y) / canvasSize.height) * 100}%`,
+ left: `${
+ 50 +
+ (
+ (dragState.isDragging && dragState.elementId === element.id
+ ? dragState.currentX
+ : element.x) / canvasSize.width
+ ) *
+ 100
+ }%`,
+ top: `${
+ 50 +
+ (
+ (dragState.isDragging && dragState.elementId === element.id
+ ? dragState.currentY
+ : element.y) / canvasSize.height
+ ) *
+ 100
+ }%`,
transform: `translate(-50%, -50%) rotate(${element.rotation}deg) scale(${scaleRatio})`,
opacity: element.opacity,
zIndex: 100 + index, // Text elements on top