- 시작 입력 가능하도록 수정
This commit is contained in:
parent
0f633cb29c
commit
04e9bfd63b
@ -28,6 +28,14 @@ export const Orientation = forwardRef(({ tabNum }, ref) => {
|
|||||||
}, [compasDeg])
|
}, [compasDeg])
|
||||||
|
|
||||||
const checkDegree = (e) => {
|
const checkDegree = (e) => {
|
||||||
|
if (e === '-0' || e === '-') {
|
||||||
|
setCompasDeg('-')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (e === '0-') {
|
||||||
|
setCompasDeg('-0')
|
||||||
|
return
|
||||||
|
}
|
||||||
if (Number(e) >= -180 && Number(e) <= 180) {
|
if (Number(e) >= -180 && Number(e) <= 180) {
|
||||||
if (numberCheck(Number(e))) {
|
if (numberCheck(Number(e))) {
|
||||||
setCompasDeg(Number(e))
|
setCompasDeg(Number(e))
|
||||||
|
|||||||
@ -23,10 +23,13 @@ export function useOrientation() {
|
|||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
const nextStep = () => {
|
const nextStep = () => {
|
||||||
|
if (isNaN(compasDeg)) {
|
||||||
|
setCompasDeg(0)
|
||||||
|
}
|
||||||
const roofs = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF)
|
const roofs = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF)
|
||||||
roofs.forEach((roof) => {
|
roofs.forEach((roof) => {
|
||||||
roof.set({
|
roof.set({
|
||||||
moduleCompass: compasDeg,
|
moduleCompass: isNaN(compasDeg) ? 0 : compasDeg,
|
||||||
})
|
})
|
||||||
drawDirectionArrow(roof)
|
drawDirectionArrow(roof)
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user