Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

ensure preview time is >= 0

Brendan Alland5c11d5e3f64
diff --git a/apps/desktop-solid/src/routes/editor/Editor.tsx b/apps/desktop-solid/src/routes/editor/Editor.tsx
index f2dd59ab5..8cbb160b6 100644
--- a/apps/desktop-solid/src/routes/editor/Editor.tsx
+++ b/apps/desktop-solid/src/routes/editor/Editor.tsx
@@ -289,7 +289,9 @@ function Inner() {
}}
onMouseMove={(e) => {
const { left, width } = e.currentTarget.getBoundingClientRect();
- setPreviewTime(duration * ((e.clientX - left) / width));
+ setPreviewTime(
+ Math.max(duration * ((e.clientX - left) / width), 0)
+ );
}}
onMouseLeave={() => {
setPreviewTime(undefined);