지붕 덮개 이동시 오류 사항에 대한 수정
This commit is contained in:
parent
aa5cc6aea3
commit
1dfd6bbdc9
@ -202,7 +202,7 @@ export function useRoofFn() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const roof = roofBase[0]
|
const roof = roofBase[0]
|
||||||
const wall = roof.wall
|
const wall = canvas.getObjects().find((obj) => obj.name === POLYGON_TYPE.WALL && obj.attributes?.roofId === roof.id)
|
||||||
|
|
||||||
const checkPolygon = new fabric.Polygon(roof.points, {
|
const checkPolygon = new fabric.Polygon(roof.points, {
|
||||||
name: 'moveRoofPolygon',
|
name: 'moveRoofPolygon',
|
||||||
@ -230,16 +230,11 @@ export function useRoofFn() {
|
|||||||
const texts = canvas.getObjects().filter((obj) => obj.type === 'text' && (obj.attributes?.roofId === roof.id || obj.parentId === roof.id))
|
const texts = canvas.getObjects().filter((obj) => obj.type === 'text' && (obj.attributes?.roofId === roof.id || obj.parentId === roof.id))
|
||||||
texts.forEach((text) => canvas.remove(text))
|
texts.forEach((text) => canvas.remove(text))
|
||||||
|
|
||||||
const outerLines = canvas.getObjects().filter((obj) => obj.type === 'QLine' && (obj.attributes?.roofId === roof.id || obj.parentId === roof.id))
|
|
||||||
|
|
||||||
const allRoofObject = canvas
|
const allRoofObject = canvas
|
||||||
.getObjects()
|
.getObjects()
|
||||||
.filter(
|
.filter((obj) => obj !== roof && (obj.attributes?.roofId === roof.id || obj.parentId === roof.id || obj.parentId === wall.id))
|
||||||
(obj) => obj !== roof && /*obj !== wall &&*/ (obj.attributes?.roofId === roof.id || obj.parentId === roof.id || obj.parentId === wall.id),
|
|
||||||
)
|
|
||||||
|
|
||||||
// // Calculate the movement delta
|
|
||||||
|
|
||||||
|
/** 지붕이 움직인 만큼의 delta를 구한다. */
|
||||||
const originalRoofLeft = roof.left
|
const originalRoofLeft = roof.left
|
||||||
const originalRoofTop = roof.top
|
const originalRoofTop = roof.top
|
||||||
|
|
||||||
|
|||||||
@ -7585,6 +7585,8 @@ const reDrawPolygon = (polygon, canvas) => {
|
|||||||
selectable: polygon.selectable,
|
selectable: polygon.selectable,
|
||||||
fontSize: polygon.fontSize,
|
fontSize: polygon.fontSize,
|
||||||
wall: polygon.wall !== undefined ? polygon.wall : null,
|
wall: polygon.wall !== undefined ? polygon.wall : null,
|
||||||
|
originX: polygon.originX,
|
||||||
|
originY: polygon.originY,
|
||||||
})
|
})
|
||||||
|
|
||||||
const newLines = newPolygon.lines
|
const newLines = newPolygon.lines
|
||||||
@ -7609,8 +7611,8 @@ const reDrawPolygon = (polygon, canvas) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
canvas?.add(newPolygon)
|
canvas.add(newPolygon)
|
||||||
canvas?.renderAll()
|
canvas.renderAll()
|
||||||
|
|
||||||
return newPolygon
|
return newPolygon
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user