refactor(edge-utils): check center params for undefined

This commit is contained in:
moklick
2020-09-27 22:28:43 +02:00
parent b7e27094bb
commit 993055e08b
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -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}`;
+2 -2
View File
@@ -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) {