Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edgestyle straight is not working #476

Open
jordandevogelaere opened this issue Sep 11, 2023 · 2 comments
Open

Edgestyle straight is not working #476

jordandevogelaere opened this issue Sep 11, 2023 · 2 comments

Comments

@jordandevogelaere
Copy link

``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>

@dcs76
Copy link

dcs76 commented Oct 25, 2023

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.

@Somfic
Copy link

Somfic commented Nov 15, 2023

Can confirm this issue still persists in the latest version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants