팔작지붕 offset validation 추가.
This commit is contained in:
parent
34d7372c35
commit
0963b60daf
@ -2732,6 +2732,7 @@ const setGableRoof = (polygon, ridge, hip1, hip2, offset, canvas) => {
|
||||
if (ridge.direction === 'top') {
|
||||
if (ridge.y1 > y1 && ridge.y2 > y1) {
|
||||
offset = Math.abs(ridge.y1 - y1) - offset
|
||||
offset = offset < 0 ? 0 : offset
|
||||
ridge.set({
|
||||
x1: ridge.x1,
|
||||
y1: ridge.y1,
|
||||
@ -2763,6 +2764,7 @@ const setGableRoof = (polygon, ridge, hip1, hip2, offset, canvas) => {
|
||||
}
|
||||
if (ridge.y1 < y1 && ridge.y2 < y1) {
|
||||
offset = Math.abs(ridge.y2 - y1) - offset
|
||||
offset = offset < 0 ? 0 : offset
|
||||
ridge.set({
|
||||
x1: ridge.x1,
|
||||
y1: ridge.y1 - offset,
|
||||
@ -2795,6 +2797,7 @@ const setGableRoof = (polygon, ridge, hip1, hip2, offset, canvas) => {
|
||||
if (ridge.direction === 'bottom') {
|
||||
if (ridge.y1 > y1 && ridge.y2 > y1) {
|
||||
offset = Math.abs(ridge.y1 - y1) - offset
|
||||
offset = offset < 0 ? 0 : offset
|
||||
ridge.set({
|
||||
x1: ridge.x1,
|
||||
y1: ridge.y1 - offset,
|
||||
@ -2825,6 +2828,7 @@ const setGableRoof = (polygon, ridge, hip1, hip2, offset, canvas) => {
|
||||
}
|
||||
if (ridge.y1 < y1 && ridge.y2 < y1) {
|
||||
offset = Math.abs(ridge.y2 - y1) - offset
|
||||
offset = offset < 0 ? 0 : offset
|
||||
ridge.set({
|
||||
x1: ridge.x1,
|
||||
y1: ridge.y1,
|
||||
@ -2858,6 +2862,7 @@ const setGableRoof = (polygon, ridge, hip1, hip2, offset, canvas) => {
|
||||
if (ridge.direction === 'right') {
|
||||
if (ridge.x1 > x1 && ridge.x2 > x1) {
|
||||
offset = Math.abs(ridge.x1 - x1) - offset
|
||||
offset = offset < 0 ? 0 : offset
|
||||
ridge.set({
|
||||
x1: ridge.x1 - offset,
|
||||
y1: ridge.y1,
|
||||
@ -2888,6 +2893,7 @@ const setGableRoof = (polygon, ridge, hip1, hip2, offset, canvas) => {
|
||||
}
|
||||
if (ridge.x1 < x1 && ridge.x2 < x1) {
|
||||
offset = Math.abs(ridge.x2 - x1) - offset
|
||||
offset = offset < 0 ? 0 : offset
|
||||
ridge.set({
|
||||
x1: ridge.x1,
|
||||
y1: ridge.y1,
|
||||
@ -2920,6 +2926,7 @@ const setGableRoof = (polygon, ridge, hip1, hip2, offset, canvas) => {
|
||||
if (ridge.direction === 'left') {
|
||||
if (ridge.x1 > x1 && ridge.x2 > x1) {
|
||||
offset = Math.abs(ridge.x1 - x1) - offset
|
||||
offset = offset < 0 ? 0 : offset
|
||||
ridge.set({
|
||||
x1: ridge.x1,
|
||||
y1: ridge.y1,
|
||||
@ -2950,6 +2957,7 @@ const setGableRoof = (polygon, ridge, hip1, hip2, offset, canvas) => {
|
||||
}
|
||||
if (ridge.x1 < x1 && ridge.x2 < x1) {
|
||||
offset = Math.abs(ridge.x2 - x1) - offset
|
||||
offset = offset < 0 ? 0 : offset
|
||||
ridge.set({
|
||||
x1: ridge.x1 - offset,
|
||||
y1: ridge.y1,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user