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
+1 -1
View File
@@ -22,7 +22,7 @@ const props = withDefaults(defineProps<EdgeTextProps>(), {
const edgeRef = templateRef<SVGTextElement>('edge-text', null)
const { width, height, x, y } = useElementBounding(edgeRef)
const transform = computed(() => `translate(${props.x - width.value / 2} ${props.y - height.value / 2})`)
const transform = computed(() => `translate(${props.x - width.value / 2 || 0} ${props.y - height.value / 2 || 0})`)
const bgPadding = computed(() => [props.labelBgPadding[0], props.labelBgPadding[1]])
</script>
<template>