pitch, angle 추가
This commit is contained in:
parent
7b2e7fd362
commit
f0e6056e32
@ -121,7 +121,7 @@ export default function RoofAllocationSetting(props) {
|
||||
onChange={(e) => {
|
||||
handleChangeInput(e, 'pitch', index)
|
||||
}}
|
||||
defaultValue={currentAngleType === 'slope' ? roof.pitch : getDegreeByChon(roof.pitch)}
|
||||
defaultValue={currentAngleType === 'slope' ? roof.pitch : roof.angle}
|
||||
/>
|
||||
</div>
|
||||
<span>{pitchText}</span>
|
||||
|
||||
@ -135,7 +135,8 @@ export function useCanvasSetting() {
|
||||
raft: item.raftBase && parseInt(item.raftBase),
|
||||
layout: ['ROOF_ID_SLATE', 'ROOF_ID_SINGLE'].includes(item.roofMatlCd) ? ROOF_MATERIAL_LAYOUT.STAIRS : ROOF_MATERIAL_LAYOUT.PARALLEL,
|
||||
hajebichi: item.roofPchBase && parseInt(item.roofPchBase),
|
||||
pitch: item.pitch && parseInt(item.pitch),
|
||||
pitch: item.pitch ? parseInt(item.pitch) : 4,
|
||||
angle: item.angle ? parseInt(item.angle) : 21.8,
|
||||
}))
|
||||
setRoofMaterials(roofLists)
|
||||
const selectedRoofMaterial = roofLists[0]
|
||||
|
||||
@ -23,7 +23,7 @@ import { menuTypeState } from '@/store/menuAtom'
|
||||
import { useRoofFn } from '@/hooks/common/useRoofFn'
|
||||
import { ROOF_MATERIAL_LAYOUT } from '@/components/floor-plan/modal/placementShape/PlacementShapeSetting'
|
||||
import { globalLocaleStore } from '@/store/localeAtom'
|
||||
import { getChonByDegree } from '@/util/canvas-util'
|
||||
import { getChonByDegree, getDegreeByChon } from '@/util/canvas-util'
|
||||
|
||||
// 지붕면 할당
|
||||
export function useRoofAllocationSetting(id) {
|
||||
@ -473,7 +473,9 @@ export function useRoofAllocationSetting(id) {
|
||||
const value = e.target.value
|
||||
const newRoofList = currentRoofList.map((roof, idx) => {
|
||||
if (idx === index) {
|
||||
return { ...roof, pitch: value }
|
||||
const result =
|
||||
currentAngleType === 'slope' ? { pitch: value, angle: getDegreeByChon(value) } : { pitch: getChonByDegree(value), angle: value }
|
||||
return { ...roof, ...result }
|
||||
}
|
||||
return roof
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user