innerLines 없는 경우 복구
This commit is contained in:
parent
15c51547ce
commit
804feae1d6
@ -1,7 +1,7 @@
|
||||
import { ANGLE_TYPE, canvasState, currentAngleTypeSelector, fontFamilyState, fontSizeState, pitchTextSelector } from '@/store/canvasAtom'
|
||||
import { ANGLE_TYPE, canvasState, currentAngleTypeSelector, pitchTextSelector } from '@/store/canvasAtom'
|
||||
import { useRecoilValue } from 'recoil'
|
||||
import { fabric } from 'fabric'
|
||||
import { findAndRemoveClosestPoint, getDegreeByChon, getDegreeInOrientation, getDirectionByPoint, isPointOnLine } from '@/util/canvas-util'
|
||||
import { findAndRemoveClosestPoint, getDegreeByChon, getDegreeInOrientation, isPointOnLine } from '@/util/canvas-util'
|
||||
import { QPolygon } from '@/components/fabric/QPolygon'
|
||||
import { isSamePoint, removeDuplicatePolygons } from '@/util/qpolygon-utils'
|
||||
import { flowDisplaySelector } from '@/store/settingAtom'
|
||||
@ -753,6 +753,25 @@ export const usePolygon = () => {
|
||||
polygon.set({ visible: false })
|
||||
let innerLines = [...polygon.innerLines]
|
||||
|
||||
// innerLine이 세팅이 안되어있는경우 찾아서 세팅한다.
|
||||
if (!innerLines || innerLines.length === 0) {
|
||||
let innerLineTypes = []
|
||||
Object.keys(LINE_TYPE.SUBLINE).forEach((key, value) => {
|
||||
innerLineTypes.push(LINE_TYPE.SUBLINE[key])
|
||||
})
|
||||
polygon.innerLines = canvas
|
||||
.getObjects()
|
||||
.filter(
|
||||
(obj) =>
|
||||
obj.type === 'QLine' &&
|
||||
obj.attributes?.type !== 'pitchSizeLine' &&
|
||||
obj.attributes?.roofId === polygon.id &&
|
||||
(innerLineTypes.includes(obj.name) || !obj.name),
|
||||
)
|
||||
|
||||
innerLines = [...polygon.innerLines]
|
||||
}
|
||||
|
||||
canvas.renderAll()
|
||||
let polygonLines = [...polygon.lines]
|
||||
const roofs = []
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user