기존 저장된 지붕재 index 수정

This commit is contained in:
hyojun.choi 2025-03-27 15:17:42 +09:00
parent 6f5b70342d
commit de5901492b

View File

@ -308,8 +308,17 @@ export function useRoofAllocationSetting(id) {
*/ */
const handleSaveContext = () => { const handleSaveContext = () => {
const newRoofList = currentRoofList.map((roof, idx) => { const newRoofList = currentRoofList.map((roof, idx) => {
if (roof.index !== idx) {
// 기존 저장된 지붕재의 index 수정
const roofs = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF && obj.roofMaterial?.index === roof.index)
roofs.forEach((roof) => {
setSurfaceShapePattern(roof, roofDisplay.column, false, { ...roof, index: idx }, true)
})
}
return { ...roof, index: idx, raft: roof.raft ? roof.raft : roof.raftBaseCd } return { ...roof, index: idx, raft: roof.raft ? roof.raft : roof.raftBaseCd }
}) })
setBasicSetting((prev) => { setBasicSetting((prev) => {
return { return {
...prev, ...prev,