면형상 가대 배치시 이동으로 인한 좌표 틀어짐 수정

This commit is contained in:
yjnoh 2024-09-04 16:15:33 +09:00
parent 0119e3fac2
commit 6c86b1181c

View File

@ -648,7 +648,7 @@ export function useMode() {
}
case 'Enter': {
const result = prompt('입력하세요 (a(A패턴),b(B패턴),t(지붕))')
const result = prompt('입력하세요 (a(A패턴), b(B패턴), t(지붕), e(변별))')
switch (result) {
case 'a':
@ -660,6 +660,8 @@ export function useMode() {
case 't':
templateMode()
break
case 'e':
templateSideMode()
}
}
}
@ -1051,6 +1053,18 @@ export function useMode() {
setTemplateType(1)
}
}
const templateSideMode = () => {
changeMode(canvas, Mode.EDIT)
if (historyPoints.current.length >= 4) {
const wall = drawWallPolygon()
setWall(wall)
console.log('sideWall', wall)
}
}
/**
* 점을 연결하는 선과 길이를 그립니다.
* a : 시작점, b : 끝점
@ -4583,8 +4597,10 @@ export function useMode() {
canvas?.off('mouse:move')
canvas?.off('mouse:out')
const roofs = canvas?.getObjects().filter((obj) => obj.name === 'roof')
roofs.forEach((roof, index) => {
const offsetPolygonPoint = offsetPolygon(roof.points, -20)
// const offsetPolygonPoint = offsetPolygon(roof.points(), -20) //이동되서 찍을라고 바꿈
const offsetPolygonPoint = offsetPolygon(roof.getCurrentPoints(), -20)
const trestlePoly = new QPolygon(offsetPolygonPoint, {
fill: 'transparent',