외벽선 확정 추가
This commit is contained in:
parent
bccca5f817
commit
c06216bdb2
@ -99,15 +99,16 @@ export default function OuterLineWall() {
|
|||||||
if (idx === 0) {
|
if (idx === 0) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
drawLine(points[idx - 1], point)
|
drawLine(points[idx - 1], point, idx)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}, [points])
|
}, [points])
|
||||||
|
|
||||||
const drawLine = (point1, point2) => {
|
const drawLine = (point1, point2, idx) => {
|
||||||
const line = new QLine([point1.x, point1.y, point2.x, point2.y], {
|
const line = new QLine([point1.x, point1.y, point2.x, point2.y], {
|
||||||
stroke: 'black',
|
stroke: 'black',
|
||||||
strokeWidth: 1,
|
strokeWidth: 1,
|
||||||
|
idx: idx,
|
||||||
selectable: false,
|
selectable: false,
|
||||||
name: 'outerLine',
|
name: 'outerLine',
|
||||||
})
|
})
|
||||||
@ -120,7 +121,6 @@ export default function OuterLineWall() {
|
|||||||
const checkRightAngle = () => {
|
const checkRightAngle = () => {
|
||||||
const length1Num = Number(length1Ref.current.value) / 10
|
const length1Num = Number(length1Ref.current.value) / 10
|
||||||
const length2Num = Number(length2Ref.current.value) / 10
|
const length2Num = Number(length2Ref.current.value) / 10
|
||||||
console.log(length1Num, length2Num, arrow1Ref.current, arrow2Ref.current)
|
|
||||||
|
|
||||||
if (points.length === 0) {
|
if (points.length === 0) {
|
||||||
return
|
return
|
||||||
@ -258,6 +258,7 @@ export default function OuterLineWall() {
|
|||||||
if (activeElem === length1Ref.current) {
|
if (activeElem === length1Ref.current) {
|
||||||
setArrow1('↓')
|
setArrow1('↓')
|
||||||
arrow1Ref.current = '↓'
|
arrow1Ref.current = '↓'
|
||||||
|
length2Ref.current.focus()
|
||||||
} else if (activeElem === length2Ref.current) {
|
} else if (activeElem === length2Ref.current) {
|
||||||
if (arrow1Ref.current === '↓' || arrow1Ref.current === '↑') {
|
if (arrow1Ref.current === '↓' || arrow1Ref.current === '↑') {
|
||||||
break
|
break
|
||||||
@ -274,6 +275,7 @@ export default function OuterLineWall() {
|
|||||||
if (activeElem === length1Ref.current) {
|
if (activeElem === length1Ref.current) {
|
||||||
setArrow1('↑')
|
setArrow1('↑')
|
||||||
arrow1Ref.current = '↑'
|
arrow1Ref.current = '↑'
|
||||||
|
length2Ref.current.focus()
|
||||||
} else if (activeElem === length2Ref.current) {
|
} else if (activeElem === length2Ref.current) {
|
||||||
if (arrow1Ref.current === '↓' || arrow1Ref.current === '↑') {
|
if (arrow1Ref.current === '↓' || arrow1Ref.current === '↑') {
|
||||||
break
|
break
|
||||||
@ -289,6 +291,7 @@ export default function OuterLineWall() {
|
|||||||
if (activeElem === length1Ref.current) {
|
if (activeElem === length1Ref.current) {
|
||||||
setArrow1('←')
|
setArrow1('←')
|
||||||
arrow1Ref.current = '←'
|
arrow1Ref.current = '←'
|
||||||
|
length2Ref.current.focus()
|
||||||
} else if (activeElem === length2Ref.current) {
|
} else if (activeElem === length2Ref.current) {
|
||||||
if (arrow1Ref.current === '←' || arrow1Ref.current === '→') {
|
if (arrow1Ref.current === '←' || arrow1Ref.current === '→') {
|
||||||
break
|
break
|
||||||
@ -304,6 +307,7 @@ export default function OuterLineWall() {
|
|||||||
if (activeElem === length1Ref.current) {
|
if (activeElem === length1Ref.current) {
|
||||||
setArrow1('→')
|
setArrow1('→')
|
||||||
arrow1Ref.current = '→'
|
arrow1Ref.current = '→'
|
||||||
|
length2Ref.current.focus()
|
||||||
} else if (activeElem === length2Ref.current) {
|
} else if (activeElem === length2Ref.current) {
|
||||||
if (arrow1Ref.current === '←' || arrow1Ref.current === '→') {
|
if (arrow1Ref.current === '←' || arrow1Ref.current === '→') {
|
||||||
break
|
break
|
||||||
@ -316,6 +320,15 @@ export default function OuterLineWall() {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
leeGubae: (e) => {
|
||||||
|
console.log('leegubae')
|
||||||
|
},
|
||||||
|
angle: (e) => {
|
||||||
|
console.log('angle')
|
||||||
|
},
|
||||||
|
diagonalLine: (e) => {
|
||||||
|
console.log('diagonalLine')
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -330,7 +343,14 @@ export default function OuterLineWall() {
|
|||||||
setModalOption({ ...modalOption, outerwall: false })
|
setModalOption({ ...modalOption, outerwall: false })
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleFix = () => {}
|
const handleFix = () => {
|
||||||
|
setPoints((prev) => {
|
||||||
|
if (prev.length === 0) {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
return [...prev, { x: prev[0].x, y: prev[0].y }]
|
||||||
|
})
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<WithDraggable isShow={true}>
|
<WithDraggable isShow={true}>
|
||||||
<div className={`modal-pop-wrap ssm ${modalOption.outerwall ? 'mount' : ''} `}>
|
<div className={`modal-pop-wrap ssm ${modalOption.outerwall ? 'mount' : ''} `}>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user