fix: warnings when NaN values are passed to svg transformations

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-11-15 12:44:09 +01:00
parent 3705a39fa8
commit 9c3eeef5eb
6 changed files with 62 additions and 45 deletions
+9 -11
View File
@@ -52,21 +52,19 @@ const centerX = computed(() => {
const xOffset = Math.abs(props.targetX - props.sourceX) / 2
return props.targetX < props.sourceX ? props.targetX + xOffset : props.targetX - xOffset
})
const path = computed(() =>
getBezierPath({
...props,
}),
)
const path = computed(() => {
if (props.sourceX && props.sourceY)
return getBezierPath({
...props,
})
else return ''
})
const markerEnd = computed(() => getMarkerEnd(props.arrowHeadType, props.markerEndId))
</script>
<template>
<path
:style="props.style"
class="vue-flow__edge-path"
:d="`M ${props.sourceX},${props.sourceY}L ${props.targetX},${props.targetY}`"
:marker-end="markerEnd"
/>
<path :style="props.style" class="vue-flow__edge-path" :d="path" :marker-end="markerEnd" />
<EdgeText
v-if="props.label"
:x="centerX"