path.el.getPointAtLength is not a function[Learn More] anime.js:490:16
See original GitHub issueThis happens in Safari and Firefox but not in Chrome.
function getPathProgress(path, progress) {
function point(offset = 0) {
const l = progress + offset >= 1 ? progress + offset : 0;
return path.el.getPointAtLength(l); // here
}
const p = point();
const p0 = point(-1);
const p1 = point(+1);
switch (path.property) {
case 'x': return p.x;
case 'y': return p.y;
case 'angle': return Math.atan2(p1.y - p0.y, p1.x - p0.x) * 180 / Math.PI;
}
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
SVGGeometryElement.getPointAtLength() - Web APIs | MDN
The SVGGeometryElement.getPointAtLength() method returns the point at a given distance along the path.
Read more >getPointAtLength with SVG not working correctly
As you loop through flattening the path, call the mypath.getPathSegAtLength() function. It returns the index of the pathseg entry at that length ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Can someone help me fix this error, this pops when I run the anime.js file.
Hello! Make sure that on the path definition your adding path to the end of the sentence! I’ve found this video which is very helpful. don’t forget to add the path at the end! in my case this was the issue, I was only doing anime.path(“SVG”) instead of anime.path(“SVG path”)
https://youtu.be/mAKYW_1f-dw