From 937f2eb3feadaa95ad1742ddb84c9db352ed61c6 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Wed, 30 Apr 2025 13:26:05 +0900 Subject: [PATCH] =?UTF-8?q?x=EA=B0=80=20=EC=A0=84=EB=B6=80=20=EA=B0=99?= =?UTF-8?q?=EA=B1=B0=EB=82=98,=20y=EA=B0=80=20=EC=A0=84=EB=B6=80=20?= =?UTF-8?q?=EA=B0=99=EC=9D=80=EA=B2=BD=EC=9A=B0=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/util/qpolygon-utils.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/util/qpolygon-utils.js b/src/util/qpolygon-utils.js index 9fbfc6a3..131e9232 100644 --- a/src/util/qpolygon-utils.js +++ b/src/util/qpolygon-utils.js @@ -303,7 +303,13 @@ export function removeDuplicatePolygons(polygons) { } }) - return uniquePolygons + // x가 전부 같거나, y가 전부 같은 경우 제거 + return uniquePolygons.filter((polygon) => { + const xValues = polygon.map((point) => point.x) + const yValues = polygon.map((point) => point.y) + + return !(xValues.every((x) => x === xValues[0]) || yValues.every((y) => y === yValues[0])) + }) } export const isSamePoint = (a, b) => {