mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-01-07 00:06:57 +01:00
fix(web): object mask editing not showing points
This commit is contained in:
parent
26e7d34f18
commit
d4e512c1fc
@ -190,7 +190,7 @@ ${Object.keys(zonePoints)
|
|||||||
const handleAddObjectMask = useCallback(() => {
|
const handleAddObjectMask = useCallback(() => {
|
||||||
const n = Object.keys(objectMaskPoints).filter((name) => name.startsWith('object_')).length;
|
const n = Object.keys(objectMaskPoints).filter((name) => name.startsWith('object_')).length;
|
||||||
const newObjectName = `object_${n}`;
|
const newObjectName = `object_${n}`;
|
||||||
const newObjectMaskPoints = { ...objectMaskPoints, [newObjectName]: [] };
|
const newObjectMaskPoints = { ...objectMaskPoints, [newObjectName]: [[]] };
|
||||||
setObjectMaskPoints(newObjectMaskPoints);
|
setObjectMaskPoints(newObjectMaskPoints);
|
||||||
setEditing({ set: newObjectMaskPoints, key: newObjectName, subkey: 0, fn: setObjectMaskPoints });
|
setEditing({ set: newObjectMaskPoints, key: newObjectName, subkey: 0, fn: setObjectMaskPoints });
|
||||||
}, [objectMaskPoints, setObjectMaskPoints, setEditing]);
|
}, [objectMaskPoints, setObjectMaskPoints, setEditing]);
|
||||||
@ -242,7 +242,7 @@ ${Object.keys(objectMaskPoints)
|
|||||||
<CameraImage imageRef={imageRef} camera={camera} />
|
<CameraImage imageRef={imageRef} camera={camera} />
|
||||||
<EditableMask
|
<EditableMask
|
||||||
onChange={handleUpdateEditable}
|
onChange={handleUpdateEditable}
|
||||||
points={editing.subkey ? editing.set[editing.key][editing.subkey] : editing.set[editing.key]}
|
points={'subkey' in editing ? editing.set[editing.key][editing.subkey] : editing.set[editing.key]}
|
||||||
scale={imageScale}
|
scale={imageScale}
|
||||||
snap={snap}
|
snap={snap}
|
||||||
width={width}
|
width={width}
|
||||||
|
Loading…
Reference in New Issue
Block a user