fix: add NaN guard in handleZoomCustomScaleChange before state update

This commit is contained in:
makaradam
2026-05-02 11:32:31 +02:00
parent f3dcbf2867
commit 42127e647f
+3 -3
View File
@@ -850,11 +850,11 @@ export default function VideoEditor() {
const handleZoomCustomScaleChange = useCallback(
(scale: number) => {
if (!selectedZoomId) return;
const rounded = Math.round(scale * 100) / 100;
if (!Number.isFinite(rounded)) return;
updateState((prev) => ({
zoomRegions: prev.zoomRegions.map((region) =>
region.id === selectedZoomId
? { ...region, customScale: Math.round(scale * 100) / 100 }
: region,
region.id === selectedZoomId ? { ...region, customScale: rounded } : region,
),
}));
},