diff --git a/src/hooks/module/useTrestle.js b/src/hooks/module/useTrestle.js index 8a41149d..0aea8bfc 100644 --- a/src/hooks/module/useTrestle.js +++ b/src/hooks/module/useTrestle.js @@ -1627,6 +1627,8 @@ export const useTrestle = () => { // 랙 없음의 지지금구를 그린다. const drawBracketWithOutRack = (module, rackIntvlPct, count, l, direction, moduleIntvlHor, moduleIntvlVer) => { const { leftFindModuleList, rightFindModuleList, centerFindModuleList } = module + rackIntvlPct = rackIntvlPct === 0 ? 1 : rackIntvlPct // 0인 경우 1로 변경 + rackIntvlPct = 100 / rackIntvlPct // 퍼센트로 변경 let { width, height, left, top } = module let startPointX @@ -1641,14 +1643,14 @@ export const useTrestle = () => { break } else if (direction === 'east') { startPointX = left + width - startPointY = top + height - height / rackIntvlPct + startPointY = top + height - height / rackIntvlPct - 10 break } else if (direction === 'west') { startPointX = left startPointY = top + height / rackIntvlPct break } else if (direction === 'north') { - startPointX = left + width - width / rackIntvlPct + startPointX = left + width - width / rackIntvlPct - 10 startPointY = top break } @@ -1657,7 +1659,7 @@ export const useTrestle = () => { case 'R': { // 오른쪽부분 시작 점 if (direction === 'south') { - startPointX = left + width - width / rackIntvlPct + startPointX = left + width - width / rackIntvlPct - 10 startPointY = top + height / 2 + height / 2 break } else if (direction === 'east') { @@ -1666,7 +1668,7 @@ export const useTrestle = () => { break } else if (direction === 'west') { startPointX = left - startPointY = top + height - height / rackIntvlPct + startPointY = top + height - height / rackIntvlPct - 10 break } else if (direction === 'north') { startPointX = left + width / rackIntvlPct