refactor(edge-utils): check center params for undefined
This commit is contained in:
@@ -29,8 +29,8 @@ export function getBezierPath({
|
||||
const [_centerX, _centerY] = getCenter({ sourceX, sourceY, targetX, targetY });
|
||||
const leftAndRight = [Position.Left, Position.Right];
|
||||
|
||||
const cX = centerX ? centerX : _centerX;
|
||||
const cY = centerY ? centerY : _centerY;
|
||||
const cX = typeof centerX !== 'undefined' ? centerX : _centerX;
|
||||
const cY = typeof centerY !== 'undefined' ? centerY : _centerY;
|
||||
|
||||
let path = `M${sourceX},${sourceY} C${sourceX},${cY} ${targetX},${cY} ${targetX},${targetY}`;
|
||||
|
||||
|
||||
@@ -66,8 +66,8 @@ export function getSmoothStepPath({
|
||||
let firstCornerPath = null;
|
||||
let secondCornerPath = null;
|
||||
|
||||
const cX = centerX ? centerX : _centerX;
|
||||
const cY = centerY ? centerY : _centerY;
|
||||
const cX = typeof centerX !== 'undefined' ? centerX : _centerX;
|
||||
const cY = typeof centerY !== 'undefined' ? centerY : _centerY;
|
||||
|
||||
// default case: source and target positions are top or bottom
|
||||
if (sourceX <= targetX) {
|
||||
|
||||
Reference in New Issue
Block a user