Compare commits
No commits in common. "fd203aeb1088614edc9c926fec0812c47083c271" and "c58f2306072a6184e2b4e836ceaa3767d610d259" have entirely different histories.
fd203aeb10
...
c58f230607
@ -847,8 +847,7 @@ export const usePolygon = () => {
|
|||||||
// innerLine의 type을 polygonLine의 type으로 변경
|
// innerLine의 type을 polygonLine의 type으로 변경
|
||||||
if (polygonLine.attributes?.type && innerLine.attributes) {
|
if (polygonLine.attributes?.type && innerLine.attributes) {
|
||||||
polygonLine.need = false
|
polygonLine.need = false
|
||||||
innerLine.attributes = polygonLine.attributes
|
innerLine.attributes.type = polygonLine.attributes.type
|
||||||
innerLine.direction = polygonLine.direction
|
|
||||||
innerLine.attributes.isStart = true
|
innerLine.attributes.isStart = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -904,28 +903,6 @@ export const usePolygon = () => {
|
|||||||
line.endPoint = endPoint
|
line.endPoint = endPoint
|
||||||
})
|
})
|
||||||
|
|
||||||
// polygonLines과 innerLines에서 startPoint, endPoint가 같은 라인을 innerLines에서 제거하고 canvas에서도 제거
|
|
||||||
const linesToRemove = []
|
|
||||||
innerLines = innerLines.filter((innerLine) => {
|
|
||||||
const shouldRemove = polygonLines.some((polygonLine) => {
|
|
||||||
return (
|
|
||||||
(isSamePoint(innerLine.startPoint, polygonLine.startPoint) && isSamePoint(innerLine.endPoint, polygonLine.endPoint)) ||
|
|
||||||
(isSamePoint(innerLine.startPoint, polygonLine.endPoint) && isSamePoint(innerLine.endPoint, polygonLine.startPoint))
|
|
||||||
)
|
|
||||||
})
|
|
||||||
if (shouldRemove) {
|
|
||||||
linesToRemove.push(innerLine)
|
|
||||||
}
|
|
||||||
return !shouldRemove
|
|
||||||
})
|
|
||||||
|
|
||||||
// 중복된 라인들을 canvas에서 제거
|
|
||||||
linesToRemove.forEach((line) => {
|
|
||||||
canvas.remove(line)
|
|
||||||
})
|
|
||||||
|
|
||||||
canvas.renderAll()
|
|
||||||
|
|
||||||
/*polygonLines.forEach((line) => {
|
/*polygonLines.forEach((line) => {
|
||||||
line.set({ strokeWidth: 10 })
|
line.set({ strokeWidth: 10 })
|
||||||
canvas.add(line)
|
canvas.add(line)
|
||||||
@ -1274,10 +1251,7 @@ export const usePolygon = () => {
|
|||||||
return (
|
return (
|
||||||
index ===
|
index ===
|
||||||
self.findIndex((l) => {
|
self.findIndex((l) => {
|
||||||
return (
|
return isSamePoint(l.startPoint, line.startPoint) && isSamePoint(l.endPoint, line.endPoint)
|
||||||
(isSamePoint(l.startPoint, line.startPoint) && isSamePoint(l.endPoint, line.endPoint)) ||
|
|
||||||
(isSamePoint(l.startPoint, line.endPoint) && isSamePoint(l.endPoint, line.startPoint))
|
|
||||||
)
|
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user