멀티 모듈 위치 수정

This commit is contained in:
yjnoh 2025-02-20 17:45:04 +09:00
parent 4534a99ac3
commit c4fa290dd5

View File

@ -387,6 +387,7 @@ export function useModuleBasicSetting(tabNum) {
*/
const manualModuleSetup = () => {
// console.log('isManualModuleSetup', isManualModuleSetup)
const moduleSetupSurfaces = canvas?.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE) //모듈설치면를 가져옴
if (isManualModuleSetup) {
@ -414,7 +415,7 @@ export function useModuleBasicSetting(tabNum) {
const moduleOptions = {
fill: checkedModule[0].color,
stroke: 'black',
strokeWidth: 0.1,
strokeWidth: 0.3,
selectable: true, // 선택 가능하게 설정
lockMovementX: true, // X 축 이동 잠금
lockMovementY: true, // Y 축 이동 잠금
@ -933,6 +934,10 @@ export function useModuleBasicSetting(tabNum) {
//근데 양변이 곡선이면 중앙에 맞추기 위해 아래와 위의 길이를 재서 모듈의 길이를 나눠서 들어갈수 있는 갯수가 동일하면 가운데로 정렬 시킨다
if (flowLines.left.type === 'curve' && flowLines.right.type === 'curve') {
startPointX = flowLines.left.x1 + (calcAreaWidth - totalModuleWidthCount * width) / 2
if (flowLines.left.x1 < flowLines.bottom.x1) {
startPointX = flowLines.left.x1
}
}
let heightMargin = 0
@ -948,7 +953,7 @@ export function useModuleBasicSetting(tabNum) {
let isInstall = false
for (let i = 0; i < moduleMaxRows; i++) {
let moduleY = flowLines.bottom.y1 - height * i - 0.1 //살짝 여유를 준다
let moduleY = flowLines.bottom.y1 - height * i - 1 //살짝 여유를 준다
//두번째 모듈 -> 혼합일 경우의 설치될 모듈 높이를 계산
if (moduleIndex > 0) {
@ -964,7 +969,7 @@ export function useModuleBasicSetting(tabNum) {
heightMargin = i === 0 ? 0 : intvVer * i
for (let j = 0; j < totalModuleWidthCount; j++) {
let moduleX = startPointX + width * j + 0.1 //5정도 마진을 준다
let moduleX = startPointX + width * j + 1 //5정도 마진을 준다
widthMargin = j === 0 ? 0 : intvHor * j // 가로 마진값
chidoriLength = 0 //치도리가 아니여도 기본값을 5정도 준다
if (isChidori && !isMaxSetup) {
@ -1024,9 +1029,9 @@ export function useModuleBasicSetting(tabNum) {
// }
} else {
//디버깅용
// tempModule.set({ fill: 'transparent', stroke: 'red', strokeWidth: 1 })
// canvas?.add(tempModule)
// canvas.renderAll()
tempModule.set({ fill: 'transparent', stroke: 'red', strokeWidth: 1 })
canvas?.add(tempModule)
canvas.renderAll()
}
}
if (isInstall) {
@ -1893,13 +1898,13 @@ export function useModuleBasicSetting(tabNum) {
// }
} else {
//디버깅용
// tempModule.set({ fill: 'transparent', stroke: 'red', strokeWidth: 1 })
// canvas?.add(tempModule)
// canvas.renderAll()
tempModule.set({ fill: 'transparent', stroke: 'red', strokeWidth: 1 })
canvas?.add(tempModule)
canvas.renderAll()
}
}
installedLastHeightCoord = moduleY + height + heightMargin
installedLastHeightCoord = moduleY - width - heightMargin
if (isInstall) {
++installedModuleHeightCount
@ -2462,7 +2467,7 @@ export function useModuleBasicSetting(tabNum) {
let moduleOptions = {
fill: '#BFFD9F',
stroke: 'black',
strokeWidth: 0.1,
strokeWidth: 0.3,
selectable: true, // 선택 가능하게 설정
lockMovementX: true, // X 축 이동 잠금
lockMovementY: true, // Y 축 이동 잠금
@ -2897,7 +2902,7 @@ export function useModuleBasicSetting(tabNum) {
let moduleOptions = {
fill: '#BFFD9F',
stroke: 'black',
strokeWidth: 0.1,
strokeWidth: 0.3,
selectable: true, // 선택 가능하게 설정
lockMovementX: true, // X 축 이동 잠금
lockMovementY: true, // Y 축 이동 잠금