Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 7069

Determine the position along curved link path

$
0
0

@MatthieuB wrote:

Hi,

I am trying to replicate the pathAnimation example [1], but using curved lines instead or straight ones. I am stuck at the determination of the position of the point at a fraction of the link.

The example code for straigt line is
// assume straight lines, for now
var start = link.getPoint(0);
var end = link.getPoint(link.pointsCount - 1);
var x = start.x + frac * (end.x - start.x);
var y = start.y + frac * (end.y - start.y);
token.location = new go.Point(x, y);

How can I compute the new location for a curved link?

[1] http://gojs.net/latest/samples/pathAnimation.html

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles