Merge branch 'dev' of https://git.hanasys.jp/qcast3/qcast-front into feature/redo-undo

This commit is contained in:
hyojun.choi 2026-04-13 10:42:35 +09:00
commit 53226d00fd
2 changed files with 29 additions and 11 deletions

View File

@ -171,7 +171,7 @@ export default function WallLineSetting(props) {
<></>
)}
</div>
<div className="normal-font mt10">{getMessage('outerLine.property.info')}</div>
{/*<div className="normal-font mt10">{getMessage('outerLine.property.info')}</div>*/}
<div className="grid-btn-wrap">
<button className="mr5" style={{ verticalAlign: 'middle' }} onClick={() => setUseCalcPad((prev) => !prev)}>
<Image src={useCalcPad ? '/static/images/common/Icon_ON_Black.png' : '/static/images/common/Icon_OFF_Black.png'} alt="toggle" width={34} height={34} />

View File

@ -250,7 +250,7 @@ export function useRoofFn() {
const allRoofObject = canvas
.getObjects()
.filter((obj) => obj !== roof && (obj.attributes?.roofId === roof.id || obj.parentId === roof.id || obj.parentId === wall.id))
.filter((obj) => obj !== roof && (obj.attributes?.roofId === roof.id || obj.parentId === roof.id || (wall && obj.parentId === wall.id)))
/** 지붕이 움직인 만큼의 delta를 구한다. */
const originalRoofLeft = roof.left
@ -276,15 +276,33 @@ export function useRoofFn() {
// Move all related objects by the delta
allRoofObject.forEach((obj) => {
if (obj.points !== undefined) {
obj.set({
left: obj.left + deltaX,
top: obj.top + deltaY,
originX: 'center',
originY: 'center',
objectCaching: false,
})
obj.fire('polygonMoved')
obj.fire('modified')
if (obj.name === 'arrow') {
// arrow 는 originX='left' 기본값이며 polygonMoved 가 left=pathOffset(중심) 으로
// 리셋하면 origin 불일치로 위치가 밀리므로, 단순 점 이동만 수행.
obj.points = obj.points.map((p) => ({ x: p.x + deltaX, y: p.y + deltaY }))
const dim = obj._calcDimensions({})
obj.set({
left: dim.left + dim.width / 2,
top: dim.top + dim.height / 2,
width: dim.width,
height: dim.height,
pathOffset: { x: dim.left + dim.width / 2, y: dim.top + dim.height / 2 },
originX: 'center',
originY: 'center',
objectCaching: false,
})
obj.setCoords()
} else {
obj.set({
left: obj.left + deltaX,
top: obj.top + deltaY,
originX: 'center',
originY: 'center',
objectCaching: false,
})
obj.fire('polygonMoved')
obj.fire('modified')
}
} else {
obj.set({
left: obj.left + deltaX,