增加异常处理
This commit is contained in:
parent
58f90cdbee
commit
baaf3f4737
@ -1129,7 +1129,11 @@ const VersionDesigner = {
|
||||
let Model = PageModel[pos]
|
||||
if (h.linkerType == "curve" || h.linkerType == "broken") {
|
||||
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;
|
||||
@ -2517,19 +2521,23 @@ const Utils = {
|
||||
return this.getAngle(n, i)
|
||||
},
|
||||
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));
|
||||
if (e.x <= f.x && e.y > f.y) {
|
||||
d = Math.PI - d
|
||||
} else {
|
||||
if (e.x < f.x && e.y <= f.y) {
|
||||
d = Math.PI + d
|
||||
try {
|
||||
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));
|
||||
if (e.x <= f.x && e.y > f.y) {
|
||||
d = Math.PI - d
|
||||
} else {
|
||||
if (e.x >= f.x && e.y < f.y) {
|
||||
d = Math.PI * 2 - d
|
||||
if (e.x < f.x && e.y <= f.y) {
|
||||
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) {
|
||||
let Model = PageModel[pos]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user