设计器快捷调整间距 增加or减少判断条件更改

This commit is contained in:
yangl 2022-09-08 16:58:01 +08:00
parent 33aaa548c1
commit 55488bff4d
2 changed files with 7 additions and 5 deletions

View File

@ -160,9 +160,10 @@ Designer.addFunction("selectVertical", function() {
function(e) { function(e) {
var height1 = subline1.height() var height1 = subline1.height()
var height2 = subline2.height() var height2 = subline2.height()
if (height1 != 0) { // 增加 if (height1 > 0) { // 增加
moveShapeAndFile('y',sublinePos,height1) moveShapeAndFile('y',sublinePos,height1)
} else if (height2 != 0) { // 减少 }
if (height2 > 0) { // 减少
moveShapeAndFile('y',sublinePos,0-height2) moveShapeAndFile('y',sublinePos,0-height2)
} }
subline1.css({ subline1.css({
@ -749,9 +750,10 @@ Designer.addFunction("selectHorizontal", function() {
function(e) { function(e) {
var width1 = subline1.width() var width1 = subline1.width()
var width2 = subline2.width() var width2 = subline2.width()
if(width1 != 0) { // 增加 if(width1 > 0) { // 增加
moveShapeAndFile('x',sublinePos,width1) moveShapeAndFile('x',sublinePos,width1)
} else if(width2 != 0) { // 减少 }
if(width2 > 0) { // 减少
moveShapeAndFile('x',sublinePos,0-width2) moveShapeAndFile('x',sublinePos,0-width2)
} }