设计器快捷调整间距直线拐点调整
This commit is contained in:
parent
0d919bbc4b
commit
71c87ec088
@ -349,6 +349,21 @@ function moveShapeAndFile(type,sublinePos,movedDistance) {
|
|||||||
|
|
||||||
if (movingLines[i].from[type] > sublinePos && moreFromIndex == -1) {
|
if (movingLines[i].from[type] > sublinePos && moreFromIndex == -1) {
|
||||||
movingLines[i].from[type] += movedDistance
|
movingLines[i].from[type] += movedDistance
|
||||||
|
if(type == 'y') {
|
||||||
|
if(movingLines[i].from.x == movingLines[i].to.x && movingLines[i].points.length == 2) { // 直线拐点为中点
|
||||||
|
for (let k = 0; k < movingLines[i].points.length; k++) {
|
||||||
|
movingLines[i].points[k].x = movingLines[i].from.x
|
||||||
|
movingLines[i].points[k].y = (movingLines[i].from.y + movingLines[i].to.y) / 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if(movingLines[i].from.y == movingLines[i].to.y && movingLines[i].points.length == 2) { // 直线拐点为中点
|
||||||
|
for (let k = 0; k < movingLines[i].points.length; k++) {
|
||||||
|
movingLines[i].points[k].y = movingLines[i].from.y
|
||||||
|
movingLines[i].points[k].x = (movingLines[i].from.x + movingLines[i].to.x) / 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if(movingLines[i].from[type] <= sublinePos && fromIndex !== -1) {
|
} else if(movingLines[i].from[type] <= sublinePos && fromIndex !== -1) {
|
||||||
for (let j = 0; j < movingLines[i].points.length; j++) {
|
for (let j = 0; j < movingLines[i].points.length; j++) {
|
||||||
if(movingLines[i].points[j][type] == movingLines[i].from[type]) {
|
if(movingLines[i].points[j][type] == movingLines[i].from[type]) {
|
||||||
@ -359,6 +374,21 @@ function moveShapeAndFile(type,sublinePos,movedDistance) {
|
|||||||
}
|
}
|
||||||
if (movingLines[i].to[type] > sublinePos && moreToIndex == -1) {
|
if (movingLines[i].to[type] > sublinePos && moreToIndex == -1) {
|
||||||
movingLines[i].to[type] += movedDistance
|
movingLines[i].to[type] += movedDistance
|
||||||
|
if(type == 'y') {
|
||||||
|
if(movingLines[i].from.x == movingLines[i].to.x && movingLines[i].points.length == 2) { // 直线拐点为中点
|
||||||
|
for (let j = 0; j < movingLines[i].points.length; j++) {
|
||||||
|
movingLines[i].points[j].x = movingLines[i].from.x
|
||||||
|
movingLines[i].points[j].y = (movingLines[i].from.y + movingLines[i].to.y) / 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if(movingLines[i].from.y == movingLines[i].to.y && movingLines[i].points.length == 2) { // 直线拐点为中点
|
||||||
|
for (let j = 0; j < movingLines[i].points.length; j++) {
|
||||||
|
movingLines[i].points[j].y = movingLines[i].from.y
|
||||||
|
movingLines[i].points[j].x = (movingLines[i].from.x + movingLines[i].to.x) / 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if(passedShapes.length > 0 && movingLines[i].to[type] <= sublinePos && toIndex !== -1) {
|
} else if(passedShapes.length > 0 && movingLines[i].to[type] <= sublinePos && toIndex !== -1) {
|
||||||
for (let j = 0; j < movingLines[i].points.length; j++) {
|
for (let j = 0; j < movingLines[i].points.length; j++) {
|
||||||
if(movingLines[i].points[j][type] == movingLines[i].to[type]) {
|
if(movingLines[i].points[j][type] == movingLines[i].to[type]) {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user