중복제거

This commit is contained in:
ysCha 2025-12-17 15:35:00 +09:00
parent 6f58e5ad86
commit aa1e71b91f

View File

@ -575,7 +575,19 @@ export function useMovementSetting(id) {
targetBaseLines.push({ line: target, distance: 0 })
}
targetBaseLines.sort((a, b) => a.distance - b.distance)
// Remove duplicate lines
const uniqueLines = new Map();
targetBaseLines = targetBaseLines.filter(item => {
const key = `${item.line.x1},${item.line.y1},${item.line.x2},${item.line.y2}`;
if (!uniqueLines.has(key)) {
uniqueLines.set(key, true);
return true;
}
return false;
});
// Sort by distance
targetBaseLines.sort((a, b) => a.distance - b.distance);
targetBaseLines = targetBaseLines.filter((line) => line.distance === targetBaseLines[0].distance)
if (isGableRoof) {