enforce aspect ratio on every resize frame, no debounce
This commit is contained in:
+5
-12
@@ -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
|
||||
try { await invoke("enforce_overlay_aspect") } catch {}
|
||||
await updateSize()
|
||||
enforcing = false
|
||||
}, 350)
|
||||
// Enforce ratio on every resize frame - no debounce
|
||||
enforcing = true
|
||||
try { await invoke("enforce_overlay_aspect") } catch {}
|
||||
await updateSize()
|
||||
enforcing = false
|
||||
}).then(fn => cleanup.push(fn))
|
||||
|
||||
listen<{ phase: "idle"|"recording"|"paused"; fps: number }>(
|
||||
|
||||
Reference in New Issue
Block a user