增加异常处理
This commit is contained in:
parent
d99c16cce2
commit
3eb307dcc4
@ -1129,7 +1129,11 @@ const VersionDesigner = {
|
|||||||
let Model = PageModel[pos]
|
let Model = PageModel[pos]
|
||||||
if (h.linkerType == "curve" || h.linkerType == "broken") {
|
if (h.linkerType == "curve" || h.linkerType == "broken") {
|
||||||
if (!h.points || h.points.length == 0) {
|
if (!h.points || h.points.length == 0) {
|
||||||
h.points = Utils.getLinkerPoints(h)
|
try{
|
||||||
|
h.points = Utils.getLinkerPoints(h)
|
||||||
|
}catch(e){
|
||||||
|
console.log(e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var q = h.points;
|
var q = h.points;
|
||||||
@ -2517,19 +2521,23 @@ const Utils = {
|
|||||||
return this.getAngle(n, i)
|
return this.getAngle(n, i)
|
||||||
},
|
},
|
||||||
getAngle: function (f, e) {
|
getAngle: function (f, e) {
|
||||||
var d = isNaN(Math.atan(Math.abs(f.y - e.y) / Math.abs(f.x - e.x))) ? 0 : Math.atan(Math.abs(f.y - e.y) / Math.abs(f.x - e.x));
|
try {
|
||||||
if (e.x <= f.x && e.y > f.y) {
|
var d = isNaN(Math.atan(Math.abs(f.y - e.y) / Math.abs(f.x - e.x))) ? 0 : Math.atan(Math.abs(f.y - e.y) / Math.abs(f.x - e.x));
|
||||||
d = Math.PI - d
|
if (e.x <= f.x && e.y > f.y) {
|
||||||
} else {
|
d = Math.PI - d
|
||||||
if (e.x < f.x && e.y <= f.y) {
|
|
||||||
d = Math.PI + d
|
|
||||||
} else {
|
} else {
|
||||||
if (e.x >= f.x && e.y < f.y) {
|
if (e.x < f.x && e.y <= f.y) {
|
||||||
d = Math.PI * 2 - d
|
d = Math.PI + d
|
||||||
|
} else {
|
||||||
|
if (e.x >= f.x && e.y < f.y) {
|
||||||
|
d = Math.PI * 2 - d
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return d
|
||||||
|
}catch (e) {
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
return d
|
|
||||||
},
|
},
|
||||||
getLinkerLineStyle: function (pos, a, b) {
|
getLinkerLineStyle: function (pos, a, b) {
|
||||||
let Model = PageModel[pos]
|
let Model = PageModel[pos]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user