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