mirror of
https://gitee.com/antv/g6.git
synced 2024-12-03 20:28:36 +08:00
fix: start and end point is nan problem
This commit is contained in:
parent
442d01b787
commit
b048eea057
@ -72,15 +72,12 @@ Shape.registerEdge(
|
||||
routeCfg = { source, target, offset: style.offset, radius: style.radius };
|
||||
}
|
||||
this.routeCfg = routeCfg;
|
||||
console.log('startPoint.x === NaN', startPoint.x, isNaN(startPoint.x))
|
||||
if (isNaN(startPoint.x) || isNaN(startPoint.y)) {
|
||||
startPoint = {x: 0, y: 0};
|
||||
let path = (this as any).getPath(points);
|
||||
|
||||
if (isNaN(startPoint.x) || isNaN(startPoint.y) || isNaN(endPoint.x) || isNaN(endPoint.y)) {
|
||||
path = '';
|
||||
}
|
||||
if (isNaN(endPoint.x) || isNaN(endPoint.y)) {
|
||||
endPoint = {x: 0, y: 0};
|
||||
}
|
||||
const path = (this as any).getPath(points);
|
||||
console.log('points', points, startPoint, endPoint, path);
|
||||
|
||||
const attrs: ShapeStyle = mix({}, Global.defaultEdge.style as ShapeStyle, style, {
|
||||
lineWidth: cfg.size,
|
||||
path,
|
||||
|
Loading…
Reference in New Issue
Block a user