모듈 배치 첫 진입 시 moduleCompass null로 설정

This commit is contained in:
hyojun.choi 2024-11-15 13:07:15 +09:00
parent 0b815f8a16
commit 917a70e5dd

View File

@ -3,6 +3,7 @@ import { canvasState } from '@/store/canvasAtom'
import { usePolygon } from '@/hooks/usePolygon' import { usePolygon } from '@/hooks/usePolygon'
import { POLYGON_TYPE } from '@/common/common' import { POLYGON_TYPE } from '@/common/common'
import { compasDegAtom } from '@/store/orientationAtom' import { compasDegAtom } from '@/store/orientationAtom'
import { useEffect } from 'react'
// 모듈,회로 구성 탭 기본설정 > 방위설정 탭 // 모듈,회로 구성 탭 기본설정 > 방위설정 탭
export function useOrientation() { export function useOrientation() {
@ -11,6 +12,16 @@ export function useOrientation() {
const { drawDirectionArrow } = usePolygon() const { drawDirectionArrow } = usePolygon()
useEffect(() => {
const roofs = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF)
roofs.forEach((roof) => {
roof.set({
moduleCompass: null,
})
drawDirectionArrow(roof)
})
}, [])
const nextStep = () => { const nextStep = () => {
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) => {