보조선 자르기 작동 이상 수정
This commit is contained in:
parent
2b0df28ab9
commit
a4d74bb41b
@ -710,9 +710,34 @@ export function useAuxiliaryDrawing(id, isUseEffect = true) {
|
|||||||
|
|
||||||
//보조선과 만나는 점을 찾는다.
|
//보조선과 만나는 점을 찾는다.
|
||||||
innerLines.forEach((line2) => {
|
innerLines.forEach((line2) => {
|
||||||
|
// line1이 canvas에 없는 경우 return
|
||||||
|
if (!canvas.getObjects().includes(line1)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (line1 === line2) {
|
if (line1 === line2) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// const originLine1 = {
|
||||||
|
// stroke : line1.stroke,
|
||||||
|
// strokeWidth: line1.strokeWidth
|
||||||
|
// }
|
||||||
|
// const originLine2 = {
|
||||||
|
// stroke: line2.stroke,
|
||||||
|
// strokeWidth: line2.strokeWidth
|
||||||
|
// }
|
||||||
|
// line1.set({stroke: 'red', strokeWidth: 10})
|
||||||
|
// line2.set({stroke: 'blue', strokeWidth: 10})
|
||||||
|
//
|
||||||
|
// canvas.renderAll()
|
||||||
|
//
|
||||||
|
// debugger
|
||||||
|
//
|
||||||
|
// line1.set(originLine1)
|
||||||
|
// line2.set(originLine2)
|
||||||
|
// canvas.renderAll()
|
||||||
|
|
||||||
|
|
||||||
const intersectionPoint = calculateIntersection(line1, line2)
|
const intersectionPoint = calculateIntersection(line1, line2)
|
||||||
if (!intersectionPoint) {
|
if (!intersectionPoint) {
|
||||||
return
|
return
|
||||||
@ -723,7 +748,7 @@ export function useAuxiliaryDrawing(id, isUseEffect = true) {
|
|||||||
const distance1 = distanceBetweenPoints({ x: line1.x1, y: line1.y1 }, intersectionPoint)
|
const distance1 = distanceBetweenPoints({ x: line1.x1, y: line1.y1 }, intersectionPoint)
|
||||||
const distance2 = distanceBetweenPoints({ x: line1.x2, y: line1.y2 }, intersectionPoint)
|
const distance2 = distanceBetweenPoints({ x: line1.x2, y: line1.y2 }, intersectionPoint)
|
||||||
|
|
||||||
if (distance1 < 1 || distance2 < 1) {
|
if (distance1 < 2 || distance2 < 2) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
//historyLine에서 기존 line을 제거한다.
|
//historyLine에서 기존 line을 제거한다.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user