Fix open arrow marker using fill color from edge instead of none
This commit is contained in:
@@ -8,7 +8,7 @@ type SymbolProps = Omit<EdgeMarker, 'type'>;
|
||||
const ArrowSymbol = ({ color = 'none', strokeWidth = 1 }: SymbolProps) => {
|
||||
const style = {
|
||||
strokeWidth,
|
||||
...(color && { stroke: color }),
|
||||
...(color && { stroke: color, fill: 'none' }),
|
||||
};
|
||||
|
||||
return <polyline style={style} strokeLinecap="round" strokeLinejoin="round" fill="none" points="-5,-4 0,0 -5,4" />;
|
||||
|
||||
@@ -11,9 +11,6 @@
|
||||
color = 'none',
|
||||
strokeWidth
|
||||
}: MarkerProps = $props();
|
||||
|
||||
// Create inline styles when explicit color is provided
|
||||
const polylineStyle = color ? `stroke: ${color}; fill: ${color};` : '';
|
||||
</script>
|
||||
|
||||
<marker
|
||||
@@ -29,7 +26,8 @@
|
||||
>
|
||||
{#if type === MarkerType.Arrow}
|
||||
<polyline
|
||||
style={polylineStyle}
|
||||
style:stroke={color}
|
||||
style:fill={'none'}
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width={strokeWidth}
|
||||
@@ -38,7 +36,8 @@
|
||||
/>
|
||||
{:else if type === MarkerType.ArrowClosed}
|
||||
<polyline
|
||||
style={polylineStyle}
|
||||
style:stroke={color}
|
||||
style:fill={color}
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width={strokeWidth}
|
||||
|
||||
Reference in New Issue
Block a user