Skip to content

Commit

Permalink
fix(svelte-examples): update connection line example closes #547
Browse files Browse the repository at this point in the history
  • Loading branch information
chrtze committed Oct 29, 2024
1 parent c20ceeb commit f3fa183
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@
let path = '';
$: {
const { sourceX, sourceY, targetX, targetY } = $connection;
path = `M${sourceX},${sourceY} C ${sourceX} ${targetY} ${sourceX} ${targetY} ${targetX},${targetY}`;
const { from, to } = $connection;
path = `M${from.x},${from.y} C ${from.x} ${to.y} ${from.x} ${to.y} ${to.x},${to.y}`;
}
</script>

{#if $connection.path}
{#if path}
<path
fill="none"
stroke-width={1.5}
class="animated"
stroke={$connection.startHandle?.handleId}
stroke={$connection.fromHandle?.id}
d={path}
/>
<circle
cx={$connection.targetX}
cy={$connection.targetY}
cx={$connection.to.x}
cy={$connection.to.y}
fill="#fff"
r={3}
stroke={$connection.startHandle?.handleId}
stroke={$connection.fromHandle?.id}
stroke-width={1.5}
/>
{/if}

0 comments on commit f3fa183

Please sign in to comment.