Merge branch 'feature/jaeyoung' into dev
This commit is contained in:
commit
f6da856623
@ -1854,20 +1854,24 @@ const changeHipAndGableRoof = (currentRoof, canvas) => {
|
|||||||
if (ridgeLines.length > 0) {
|
if (ridgeLines.length > 0) {
|
||||||
const ridge = ridgeLines[0]
|
const ridge = ridgeLines[0]
|
||||||
if (ridge.x1 === currentRoof.attributes.ridgeCoordinate.x1 && ridge.y1 === currentRoof.attributes.ridgeCoordinate.y1) {
|
if (ridge.x1 === currentRoof.attributes.ridgeCoordinate.x1 && ridge.y1 === currentRoof.attributes.ridgeCoordinate.y1) {
|
||||||
|
const signX = Math.sign(midX - ridge.x1)
|
||||||
|
const signY = Math.sign(midY - ridge.y1)
|
||||||
ridge.set({
|
ridge.set({
|
||||||
x1: midX + xWidth,
|
x1: midX - signX * Math.abs(xWidth),
|
||||||
y1: midY + yWidth,
|
y1: midY - signY * Math.abs(yWidth),
|
||||||
x2: ridge.x2,
|
x2: ridge.x2,
|
||||||
y2: ridge.y2,
|
y2: ridge.y2,
|
||||||
})
|
})
|
||||||
currentRoof.attributes.ridgeCoordinate = { x1: ridge.x1, y1: ridge.y1 }
|
currentRoof.attributes.ridgeCoordinate = { x1: ridge.x1, y1: ridge.y1 }
|
||||||
}
|
}
|
||||||
if (ridge.x2 === currentRoof.attributes.ridgeCoordinate.x1 && ridge.y2 === currentRoof.attributes.ridgeCoordinate.y1) {
|
if (ridge.x2 === currentRoof.attributes.ridgeCoordinate.x1 && ridge.y2 === currentRoof.attributes.ridgeCoordinate.y1) {
|
||||||
|
const signX = Math.sign(midX - ridge.x2)
|
||||||
|
const signY = Math.sign(midY - ridge.y2)
|
||||||
ridge.set({
|
ridge.set({
|
||||||
x1: ridge.x1,
|
x1: ridge.x1,
|
||||||
y1: ridge.y1,
|
y1: ridge.y1,
|
||||||
x2: midX - xWidth,
|
x2: midX - signX * Math.abs(xWidth),
|
||||||
y2: midY - yWidth,
|
y2: midY - signY * Math.abs(yWidth),
|
||||||
})
|
})
|
||||||
currentRoof.attributes.ridgeCoordinate = { x1: ridge.x2, y1: ridge.y2 }
|
currentRoof.attributes.ridgeCoordinate = { x1: ridge.x2, y1: ridge.y2 }
|
||||||
}
|
}
|
||||||
@ -2086,28 +2090,32 @@ const changeJerkInHeadRoof = (currentRoof, canvas) => {
|
|||||||
if (ridgeLines.length > 0) {
|
if (ridgeLines.length > 0) {
|
||||||
const ridge = ridgeLines[0]
|
const ridge = ridgeLines[0]
|
||||||
if (ridge.x1 === currentRoof.attributes.ridgeCoordinate.x1 && ridge.y1 === currentRoof.attributes.ridgeCoordinate.y1) {
|
if (ridge.x1 === currentRoof.attributes.ridgeCoordinate.x1 && ridge.y1 === currentRoof.attributes.ridgeCoordinate.y1) {
|
||||||
|
const signX = Math.sign(midX - ridge.x1)
|
||||||
|
const signY = Math.sign(midY - ridge.y1)
|
||||||
ridge.set({
|
ridge.set({
|
||||||
x1: midX + xWidth,
|
x1: midX - signX * Math.abs(xWidth),
|
||||||
y1: midY + yWidth,
|
y1: midY - signY * Math.abs(yWidth),
|
||||||
x2: ridge.x2,
|
x2: ridge.x2,
|
||||||
y2: ridge.y2,
|
y2: ridge.y2,
|
||||||
})
|
})
|
||||||
|
|
||||||
currentRoof.attributes.ridgeCoordinate = { x1: ridge.x1, y1: ridge.y1 }
|
currentRoof.attributes.ridgeCoordinate = { x1: ridge.x1, y1: ridge.y1 }
|
||||||
hipX2 = midX + xWidth
|
hipX2 = ridge.x1
|
||||||
hipY2 = midY + yWidth
|
hipY2 = ridge.y1
|
||||||
}
|
}
|
||||||
if (ridge.x2 === currentRoof.attributes.ridgeCoordinate.x1 && ridge.y2 === currentRoof.attributes.ridgeCoordinate.y1) {
|
if (ridge.x2 === currentRoof.attributes.ridgeCoordinate.x1 && ridge.y2 === currentRoof.attributes.ridgeCoordinate.y1) {
|
||||||
|
const signX = Math.sign(midX - ridge.x2)
|
||||||
|
const signY = Math.sign(midY - ridge.y2)
|
||||||
ridge.set({
|
ridge.set({
|
||||||
x1: ridge.x1,
|
x1: ridge.x1,
|
||||||
y1: ridge.y1,
|
y1: ridge.y1,
|
||||||
x2: midX - xWidth,
|
x2: midX - signX * Math.abs(xWidth),
|
||||||
y2: midY - yWidth,
|
y2: midY - signY * Math.abs(yWidth),
|
||||||
})
|
})
|
||||||
|
|
||||||
currentRoof.attributes.ridgeCoordinate = { x1: ridge.x2, y1: ridge.y2 }
|
currentRoof.attributes.ridgeCoordinate = { x1: ridge.x2, y1: ridge.y2 }
|
||||||
hipX2 = midX - xWidth
|
hipX2 = ridge.x2
|
||||||
hipY2 = midY - yWidth
|
hipY2 = ridge.y2
|
||||||
}
|
}
|
||||||
ridge.attributes.planeSize = Math.round(Math.sqrt(Math.pow(ridge.x1 - ridge.x2, 2) + Math.pow(ridge.y1 - ridge.y2, 2)) * 10)
|
ridge.attributes.planeSize = Math.round(Math.sqrt(Math.pow(ridge.x1 - ridge.x2, 2) + Math.pow(ridge.y1 - ridge.y2, 2)) * 10)
|
||||||
ridge.attributes.actualSize = Math.round(Math.sqrt(Math.pow(ridge.x1 - ridge.x2, 2) + Math.pow(ridge.y1 - ridge.y2, 2)) * 10)
|
ridge.attributes.actualSize = Math.round(Math.sqrt(Math.pow(ridge.x1 - ridge.x2, 2) + Math.pow(ridge.y1 - ridge.y2, 2)) * 10)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user