chore(core): cleanup markers

This commit is contained in:
braks
2023-10-06 18:00:01 +02:00
committed by Braks
parent 2f2036eafc
commit 88882d0875
2 changed files with 12 additions and 7 deletions
@@ -3,7 +3,7 @@ import { computed } from 'vue'
import type { EdgeMarkerType, MarkerProps, MarkerType } from '../../types/edge' import type { EdgeMarkerType, MarkerProps, MarkerType } from '../../types/edge'
import { useVueFlow } from '../../composables' import { useVueFlow } from '../../composables'
import { getMarkerId } from '../../utils' import { getMarkerId } from '../../utils'
import Marker from './Marker.vue' import MarkerSymbols from './MarkerSymbols.vue'
const { id: vueFlowId, edges, connectionLineOptions, defaultMarkerColor: defaultColor } = $(useVueFlow()) const { id: vueFlowId, edges, connectionLineOptions, defaultMarkerColor: defaultColor } = $(useVueFlow())
@@ -45,7 +45,7 @@ export default {
<template> <template>
<defs> <defs>
<Marker <MarkerSymbols
v-for="marker of markers" v-for="marker of markers"
:id="marker.id" :id="marker.id"
:key="marker.id" :key="marker.id"
@@ -35,19 +35,24 @@ export default {
> >
<polyline <polyline
v-if="type === MarkerType.ArrowClosed" v-if="type === MarkerType.ArrowClosed"
:stroke="color" :style="{
stroke: color,
fill: color,
strokeWidth,
}"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" stroke-linejoin="round"
:stroke-width="strokeWidth"
:fill="color"
points="-5,-4 0,0 -5,4 -5,-4" points="-5,-4 0,0 -5,4 -5,-4"
/> />
<polyline <polyline
v-if="type === MarkerType.Arrow" v-if="type === MarkerType.Arrow"
:stroke="color" :style="{
stroke: color,
strokeWidth,
}"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" stroke-linejoin="round"
:stroke-width="strokeWidth"
fill="none" fill="none"
points="-5,-4 0,0 -5,4" points="-5,-4 0,0 -5,4"
/> />