enforce aspect ratio on every resize frame, no debounce

This commit is contained in:
2026-05-29 15:32:47 +03:00
parent a1e860ef0c
commit aaddb76e6c
+2 -9
View File
@@ -36,20 +36,13 @@
win.onResized(async () => {
if (enforcing) return
await updateSize()
// Re-sync ratio from Rust in case it changed
await syncRatio()
if (lockedRatio === null) return
// Only enforce AFTER the user stops dragging.
// Reset debounce on every resize event - enforcement fires only when
// resize events stop coming (user released mouse).
resizing = true
if (resizeDebounce !== null) clearTimeout(resizeDebounce)
resizeDebounce = window.setTimeout(async () => {
resizing = false
// Enforce ratio on every resize frame - no debounce
enforcing = true
try { await invoke("enforce_overlay_aspect") } catch {}
await updateSize()
enforcing = false
}, 350)
}).then(fn => cleanup.push(fn))
listen<{ phase: "idle"|"recording"|"paused"; fps: number }>(