You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When retrieving the position at a given length along a path created from SVG data, the wrong position is returned if the given length along the path is smaller than 0.01.
As you can see, the position returned for length=0.008 is farther ahead on the line than that for length=0.12.
That's clearly a bug.
I believe the bug is here: https://github.com/konvajs/konva/blob/master/src/shapes/Path.ts#L260
where we are returning the two points of the last path segment, which in this case marks the end of the path.
Instead we should be returning the startX and startY coordinates of the segment.
The text was updated successfully, but these errors were encountered:
When retrieving the position at a given length along a path created from SVG data, the wrong position is returned if the given length along the path is smaller than 0.01.
JSFiddle: https://jsbin.com/muciqinade/edit?js,console,output
Example:
The above is a vertical line starting at position 614.96002,7.5147864 and ending at 611.20262,429.59529.
The console output will read:
As you can see, the position returned for length=0.008 is farther ahead on the line than that for length=0.12.
That's clearly a bug.
I believe the bug is here: https://github.com/konvajs/konva/blob/master/src/shapes/Path.ts#L260
where we are returning the two points of the last path segment, which in this case marks the end of the path.
Instead we should be returning the startX and startY coordinates of the segment.
The text was updated successfully, but these errors were encountered: