Compare commits
No commits in common. "1462d584be23e9d0d4bf790837dab795781f6615" and "ed955ba20706e7cacf19885a1304486ee99f92a7" have entirely different histories.
1462d584be
...
ed955ba207
@ -2322,8 +2322,8 @@ export const useTrestle = () => {
|
|||||||
if (currentModuleTpCd !== neighborModuleTpCd) {
|
if (currentModuleTpCd !== neighborModuleTpCd) {
|
||||||
sizes.push({ width: neighborWidth, height: neighborHeight })
|
sizes.push({ width: neighborWidth, height: neighborHeight })
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
/*m1.set({ fill: m1Fill })
|
m1.set({ fill: m1Fill })
|
||||||
m2.set({ fill: m2Fill })
|
m2.set({ fill: m2Fill })
|
||||||
canvas.renderAll()*/
|
canvas.renderAll()*/
|
||||||
|
|
||||||
@ -2349,24 +2349,6 @@ export const useTrestle = () => {
|
|||||||
halfMaxX = moduleIntvlHor / 10
|
halfMaxX = moduleIntvlHor / 10
|
||||||
halfMaxY = moduleIntvlVer / 10
|
halfMaxY = moduleIntvlVer / 10
|
||||||
|
|
||||||
const leftTopPoint = { x: m1X - width - moduleIntvlHor / 10, y: m1Y - height - moduleIntvlVer / 10 }
|
|
||||||
const rightTopPoint = { x: m1X + width + moduleIntvlHor / 10, y: m1Y - height - moduleIntvlVer / 10 }
|
|
||||||
const leftBottomPoint = { x: m1X - width - moduleIntvlHor / 10, y: m1Y + height + moduleIntvlVer / 10 }
|
|
||||||
const rightBottomPoint = { x: m1X + width + moduleIntvlHor / 10, y: m1Y + height + moduleIntvlVer / 10 }
|
|
||||||
// {x: m2X, y: m2Y} 가 leftTopPoint, rightTopPoint, leftBottomPoint, rightBottomPoint 내부에 있는지 확인한다.
|
|
||||||
if (
|
|
||||||
isPointInRect(
|
|
||||||
{
|
|
||||||
x: leftTopPoint.x,
|
|
||||||
y: leftTopPoint.y,
|
|
||||||
width: Math.abs(rightTopPoint.x - leftTopPoint.x),
|
|
||||||
height: Math.abs(leftTopPoint.y - leftBottomPoint.y),
|
|
||||||
},
|
|
||||||
{ x: m2X, y: m2Y },
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
if (currentModuleTpCd !== neighborModuleTpCd) {
|
if (currentModuleTpCd !== neighborModuleTpCd) {
|
||||||
maxX = currentWidth / 2 + neighborWidth / 2 + moduleIntvlHor / 10
|
maxX = currentWidth / 2 + neighborWidth / 2 + moduleIntvlHor / 10
|
||||||
maxY = currentHeight / 2 + neighborHeight / 2 + moduleIntvlVer / 10
|
maxY = currentHeight / 2 + neighborHeight / 2 + moduleIntvlVer / 10
|
||||||
@ -2391,27 +2373,6 @@ export const useTrestle = () => {
|
|||||||
halfMaxX = moduleIntvlVer / 10
|
halfMaxX = moduleIntvlVer / 10
|
||||||
halfMaxY = moduleIntvlHor / 10
|
halfMaxY = moduleIntvlHor / 10
|
||||||
|
|
||||||
// 모듈을 기준으로 왼쪽 상, 오른쪽 상, 왼쪽 하, 오른쪽 하의 각 포인트를 계산
|
|
||||||
const leftTopPoint = { x: m1X - width - moduleIntvlVer / 10, y: m1Y + height + moduleIntvlHor / 10 }
|
|
||||||
const rightTopPoint = { x: m1X - width - moduleIntvlVer / 10, y: m1Y - height - moduleIntvlHor / 10 }
|
|
||||||
const leftBottomPoint = { x: m1X + width + moduleIntvlVer / 10, y: m1Y + height + moduleIntvlHor / 10 }
|
|
||||||
const rightBottomPoint = { x: m1X + width + +moduleIntvlVer / 10, y: m1Y - height - moduleIntvlHor / 10 }
|
|
||||||
|
|
||||||
// {x: m2X, y: m2Y} 가 leftTopPoint, rightTopPoint, leftBottomPoint, rightBottomPoint 내부에 있는지 확인한다.
|
|
||||||
if (
|
|
||||||
isPointInRect(
|
|
||||||
{
|
|
||||||
x: rightTopPoint.x,
|
|
||||||
y: rightTopPoint.y,
|
|
||||||
width: Math.abs(rightBottomPoint.x - rightTopPoint.x),
|
|
||||||
height: Math.abs(leftTopPoint.y - rightTopPoint.y),
|
|
||||||
},
|
|
||||||
{ x: m2X, y: m2Y },
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
if (currentModuleTpCd !== neighborModuleTpCd) {
|
if (currentModuleTpCd !== neighborModuleTpCd) {
|
||||||
maxX = currentHeight / 2 + neighborHeight / 2 + moduleIntvlVer / 10
|
maxX = currentHeight / 2 + neighborHeight / 2 + moduleIntvlVer / 10
|
||||||
maxY = currentWidth / 2 + neighborWidth / 2 + moduleIntvlHor / 10
|
maxY = currentWidth / 2 + neighborWidth / 2 + moduleIntvlHor / 10
|
||||||
@ -2432,10 +2393,6 @@ export const useTrestle = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function isPointInRect(rect, point) {
|
|
||||||
return point.x >= rect.x && point.x <= rect.x + rect.width && point.y >= rect.y && point.y <= rect.y + rect.height
|
|
||||||
}
|
|
||||||
|
|
||||||
// 25-04-02 추가
|
// 25-04-02 추가
|
||||||
// 그룹화
|
// 그룹화
|
||||||
function groupPoints(modules, surface) {
|
function groupPoints(modules, surface) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user