pycodestyle icon indicating copy to clipboard operation
pycodestyle copied to clipboard

Edgestyle straight is not working

Open jordandevogelaere opened this issue 2 years ago • 2 comments

``Hi,

When using "straight" as EdgeStyle I'm getting following errors in my console.

CleanShot 2023-09-11 at 16 35 30@2x
<Svelvet
    id="my-canvas"
    {height}
    minimap={true}
    controls={true}
    on:connection={(e) => connectionCreated(e)}
    zoom={0.8}
    edgeStyle="straight"
>
    {#each nodes as node (node.id)}
        <BaseNode
            nodeData={node}
            onAddNodeClicked={() => addNode(node.id)}
        />
    {/each}

</Svelvet>

jordandevogelaere avatar Sep 11 '23 14:09 jordandevogelaere

In ../components/Edge/Edge.svelte, line 129, changing:

$:
  if (!step || edgeKey === "cursor" || $edgeType === "bezier") {
    path = `M ${sourceX},${sourceY} ${!straight && controlPointString} ${targetX},${targetY}`;
  }

to:

$:
  if (!step || edgeKey === "cursor" || $edgeType === "bezier") {
    path = `M ${sourceX},${sourceY} ${!straight ? controlPointString : ''} ${targetX},${targetY}`;
  }

fixes it for me.

dcs76 avatar Oct 25 '23 19:10 dcs76

Can confirm this issue still persists in the latest version

Somfic avatar Nov 15 '23 23:11 Somfic