mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-11 13:45:25 +03:00
consolidate
This commit is contained in:
parent
14854916be
commit
1940371250
@ -178,21 +178,17 @@ export function PolygonCanvas({
|
|||||||
) {
|
) {
|
||||||
let updatedPoints;
|
let updatedPoints;
|
||||||
|
|
||||||
// we've clicked near a line segment, so add a new point in the right position
|
|
||||||
if (isPointNearLineSegment(activePolygon, mousePos)) {
|
if (isPointNearLineSegment(activePolygon, mousePos)) {
|
||||||
|
// we've clicked near a line segment, so add a new point in the right position
|
||||||
updatedPoints = addPointToPolygon(activePolygon, mousePos);
|
updatedPoints = addPointToPolygon(activePolygon, mousePos);
|
||||||
updatedPolygons[activePolygonIndex] = {
|
|
||||||
...activePolygon,
|
|
||||||
points: updatedPoints,
|
|
||||||
};
|
|
||||||
} else {
|
} else {
|
||||||
updatedPoints = [...activePolygon.points, mousePos];
|
|
||||||
// Add a new point to the active polygon
|
// Add a new point to the active polygon
|
||||||
updatedPolygons[activePolygonIndex] = {
|
updatedPoints = [...activePolygon.points, mousePos];
|
||||||
...activePolygon,
|
|
||||||
points: updatedPoints,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
updatedPolygons[activePolygonIndex] = {
|
||||||
|
...activePolygon,
|
||||||
|
points: updatedPoints,
|
||||||
|
};
|
||||||
setPolygons(updatedPolygons);
|
setPolygons(updatedPolygons);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user