jagenjo / litegraph.js

A graph node engine and editor written in Javascript similar to PD or UDK Blueprints, comes with its own editor in HTML5 Canvas2D. The engine can run client side or server side using Node. It allows to export graphs as JSONs to be included in applications independently.
MIT License
5.32k stars 602 forks source link

computeConnectionPoint doesn't respect links_render_mode #457

Open chrisgoringe opened 2 months ago

chrisgoringe commented 2 months ago

At litegraph.js:9767 it says computeConnectionPoint returns the link center point:

   //returns the link center point based on curvature
    LGraphCanvas.prototype.computeConnectionPoint = function(

But in fact the function takes a value t to specify distance along the link. It then assumes a LiteGraph.SPLINE_LINK in calculating the path. This is correct for all paths if t=0.5 (the original usage, I assume, from the comment) but incorrect for other values of links_render_mode.

As a result any use of the flow animation is broken for links_render_mode != LiteGraph.SPLINE_LINK