Merge pull request '배치면의 경우 실제 길이 계산 시 통일 제거, 모듈 설치 시 영역 검사 spare 엄격하게 적용' (#642) from dev into prd-deploy

Reviewed-on: #642
This commit is contained in:
ysCha 2026-02-04 11:40:09 +09:00
commit de5370c2d3
5 changed files with 31 additions and 22 deletions

View File

@ -8,7 +8,7 @@ export const useTurf = () => {
* @param spare
* @returns
*/
const checkModuleDisjointSurface = (module, surface, spare = 1) => {
const checkModuleDisjointSurface = (module, surface, spare = 0) => {
// 표면 영역을 spare만큼 수동 확장
const expandedSurface = {
type: 'Polygon',

View File

@ -2229,7 +2229,7 @@ export function useModuleBasicSetting(tabNum) {
//첫번재 모듈 설치 후 두번째 모듈을 몇개까지 설치 할 수 있는지 계산
if (installedModuleHeightCount > 0) {
// moduleMaxRows = totalModuleMaxRows - installedModuleHeightCount //두번째 모듈일때
isChidoriLine = installedModuleHeightCount % 2 != 0 ? true : false //첫번째에서 짝수에서 끝났으면 홀수는 치도리가 아님 짝수는 치도리
isChidoriLine = installedModuleHeightCount % 2 !== 0 //첫번째에서 짝수에서 끝났으면 홀수는 치도리가 아님 짝수는 치도리
}
for (let i = 0; i < calcModuleHeightCount; i++) {
@ -2249,7 +2249,7 @@ export function useModuleBasicSetting(tabNum) {
widthMargin = j === 0 ? 0 : intvHor * j // 가로 마진값
chidoriLength = 0 //치도리가 아니여도 기본값을 5정도 준다
if (isChidori) {
chidoriLength = installedModuleHeightCount % 2 == 0 ? 0 : width / 2 - intvHor
chidoriLength = installedModuleHeightCount % 2 === 0 ? 0 : width / 2 - intvHor
}
//치도리 일때 는 짝수(1 기준) 일때만 치도리 라인으로 본다

View File

@ -241,6 +241,7 @@ export function usePlacementShapeDrawing(id) {
originY: 'center',
direction: 'south',
pitch: globalPitch,
from: 'surface',
})
setSurfaceShapePattern(roof, roofDisplay.column)

View File

@ -1045,6 +1045,7 @@ export function useSurfaceShapeBatch({ isHidden, setIsHidden }) {
newPolygon.set({
originWidth: width,
originHeight: height,
from: 'surface',
})
// 캔버스에 추가

View File

@ -1950,6 +1950,12 @@ export const usePolygon = () => {
return
}
// 배치면으로 그린 내용은 업데이트를 해준다.
if (polygon.from === 'surface') {
forceUpdate = true
}
if (polygon.from !== 'surface') {
// createdRoofs들의 모든 lines를 확인해서 length값이 1이하인 차이가 있으면 통일 시킨다.
const allRoofs = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF)
const allRoofLines = allRoofs.flatMap((roof) => roof.lines)
@ -1972,6 +1978,7 @@ export const usePolygon = () => {
}
}
}
}
polygon.lines.forEach((line, index) => {
if (line.attributes.isCalculated && !forceUpdate) {