모듈 간 거리 조정 및 roofSurface 값 수정
This commit is contained in:
parent
8f123e8356
commit
a3f4b2e487
@ -10,6 +10,8 @@ import { useSwal } from '@/hooks/useSwal'
|
|||||||
import { useContext } from 'react'
|
import { useContext } from 'react'
|
||||||
import { QcastContext } from '@/app/QcastProvider'
|
import { QcastContext } from '@/app/QcastProvider'
|
||||||
|
|
||||||
|
// 모듈간 같은 행, 열의 마진이 10 이하인 경우는 같은 행, 열로 간주
|
||||||
|
const MODULE_MARGIN = 10
|
||||||
// 회로 및 가대설정
|
// 회로 및 가대설정
|
||||||
export const useTrestle = () => {
|
export const useTrestle = () => {
|
||||||
const canvas = useRecoilValue(canvasState)
|
const canvas = useRecoilValue(canvasState)
|
||||||
@ -695,7 +697,7 @@ export const useTrestle = () => {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
roofSurfaceId: surface.id,
|
roofSurfaceId: surface.id,
|
||||||
roofSurface: directionText.replace(/[^0-9]/g, ''),
|
roofSurface: directionText.replace(/[0-9]/g, ''),
|
||||||
roofMaterialId: roofMaterial.roofMatlCd,
|
roofMaterialId: roofMaterial.roofMatlCd,
|
||||||
supportMethodId,
|
supportMethodId,
|
||||||
constructSpecification,
|
constructSpecification,
|
||||||
@ -747,8 +749,8 @@ export const useTrestle = () => {
|
|||||||
let width = widthArr.reduce((acc, num) => acc + num, 0) / widthArr.length + horizontal
|
let width = widthArr.reduce((acc, num) => acc + num, 0) / widthArr.length + horizontal
|
||||||
let height = heightArr.reduce((acc, num) => acc + num, 0) / heightArr.length + vertical
|
let height = heightArr.reduce((acc, num) => acc + num, 0) / heightArr.length + vertical
|
||||||
|
|
||||||
let maxX = 2 + (horizontal / 10) * 3
|
let maxX = MODULE_MARGIN
|
||||||
let maxY = 2 + (vertical / 10) * 3
|
let maxY = MODULE_MARGIN
|
||||||
|
|
||||||
let result
|
let result
|
||||||
switch (direction) {
|
switch (direction) {
|
||||||
@ -795,8 +797,8 @@ export const useTrestle = () => {
|
|||||||
|
|
||||||
let result
|
let result
|
||||||
let topLeftPoint
|
let topLeftPoint
|
||||||
let maxX = 2 + (horizontal / 10) * 3
|
let maxX = MODULE_MARGIN
|
||||||
let maxY = 2 + (vertical / 10) * 3
|
let maxY = MODULE_MARGIN
|
||||||
|
|
||||||
switch (direction) {
|
switch (direction) {
|
||||||
case 'south': {
|
case 'south': {
|
||||||
@ -854,8 +856,8 @@ export const useTrestle = () => {
|
|||||||
let result
|
let result
|
||||||
let topRightPoint
|
let topRightPoint
|
||||||
|
|
||||||
let maxX = 2 + (horizontal / 10) * 3
|
let maxX = MODULE_MARGIN
|
||||||
let maxY = 2 + (vertical / 10) * 3
|
let maxY = MODULE_MARGIN
|
||||||
|
|
||||||
switch (direction) {
|
switch (direction) {
|
||||||
case 'south': {
|
case 'south': {
|
||||||
@ -1677,8 +1679,8 @@ export const useTrestle = () => {
|
|||||||
|
|
||||||
const vertical = ['south', 'north'].includes(direction) ? moduleSurface.trestleDetail.moduleIntvlVer : moduleSurface.trestleDetail.moduleIntvlHor
|
const vertical = ['south', 'north'].includes(direction) ? moduleSurface.trestleDetail.moduleIntvlVer : moduleSurface.trestleDetail.moduleIntvlHor
|
||||||
|
|
||||||
const maxX = 2 + (horizontal / 10) * 3
|
const maxX = MODULE_MARGIN
|
||||||
const maxY = 2 + (vertical / 10) * 3
|
const maxY = MODULE_MARGIN
|
||||||
|
|
||||||
if (centerPoints.length === 0) return
|
if (centerPoints.length === 0) return
|
||||||
|
|
||||||
@ -2381,8 +2383,8 @@ export const useTrestle = () => {
|
|||||||
const horizontal = ['south', 'north'].includes(direction) ? moduleIntvlHor : moduleIntvlVer
|
const horizontal = ['south', 'north'].includes(direction) ? moduleIntvlHor : moduleIntvlVer
|
||||||
|
|
||||||
const vertical = ['south', 'north'].includes(direction) ? moduleIntvlVer : moduleIntvlHor
|
const vertical = ['south', 'north'].includes(direction) ? moduleIntvlVer : moduleIntvlHor
|
||||||
const maxX = 2 + (horizontal / 10) * 3
|
const maxX = MODULE_MARGIN
|
||||||
const maxY = 2 + (vertical / 10) * 3
|
const maxY = MODULE_MARGIN
|
||||||
let { widthArr, heightArr } = centerPoints[0]
|
let { widthArr, heightArr } = centerPoints[0]
|
||||||
let width = widthArr.reduce((acc, num) => acc + num, 0) / widthArr.length
|
let width = widthArr.reduce((acc, num) => acc + num, 0) / widthArr.length
|
||||||
let height = heightArr.reduce((acc, num) => acc + num, 0) / heightArr.length
|
let height = heightArr.reduce((acc, num) => acc + num, 0) / heightArr.length
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user