Skip to content

Commit 940fba4

Browse files
authored
[UNI-149] fix : 중복 포인트 삽입 문제 해결 (1, 2, 3, 4, 5, 5, 6, 7, 8) 문제 (#72)
1 parent f0a5015 commit 940fba4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

uniro_frontend/src/pages/reportRoute.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,16 @@ export default function ReportRoutePage() {
202202
const subNodes = [];
203203
const edges = newPoints.coords.map((node, idx) => [node, newPoints.coords[idx + 1]]).slice(0, -1);
204204

205+
const lastPoint = newPoints.coords[newPoints.coords.length - 1] as Node | Coord;
206+
205207
for (const edge of edges) {
206-
const subNode = createSubNodes(new Polyline({ path: edge }));
208+
const subNode = createSubNodes(new Polyline({ path: edge })).slice(0, -1);
207209
subNodes.push(...subNode);
208210
}
209211

212+
subNodes.push(lastPoint);
213+
210214
if (!originPoint.current) return;
211-
const lastPoint = newPoints.coords[newPoints.coords.length - 1] as Node | Coord;
212215

213216
if ("nodeId" in lastPoint) {
214217
mutate({

0 commit comments

Comments
 (0)