-
Notifications
You must be signed in to change notification settings - Fork 2k
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
src/geometry/Svg.js, SVGPathSeg deprecated in Chrome, will be removed #196
Comments
+1 |
Google's recommended poly fill, https://github.com/progers/pathseg |
+1 |
I've added the polyfill to the demo, anyone else wishing to use it will need to include the polyfill in their code too. It looks like rewriting the module to use the new standard would take a fair bit of work. I'm looking at other options for replacing it. Thanks guys. |
…les to look better. There was this matter.js issue: liabru/matter-js#196 that needed the polyfill to work in Chrome
I'ld like to make the suggestion to use your own SVG path data parser. We've done so in Paper.js, and the code is rather small, and has been heavily tested with all kinds of strange path data. I could split this into a separate module and add a more general purpose API to it, if this is of interest? Here the code, it's about 120 LOC: https://github.com/paperjs/paper.js/blob/develop/src/path/PathItem.js#L127 This would then also allow for the passing of an string containing SVG path-data to |
@lehni neat, can it output an array of absolute points for any given path? |
@liabru yes that should be fairly easy to achieve. But converting the bezier curves to sequence of points is another challenge (that we have solved in in paper.js, but unfortunately the library is monolithic in nature) |
Yeeah! I got a function from a code that advised @lehni and I managed to do without
It works in chrome and ios safari |
@gizmooo I got the error pathData.match is not a function |
@liabru Any update on this? The polyfill causes performance issues and freezes the browser for a few seconds |
I solved this by importing |
Chrome now reports:
SVGPathSeg is deprecated and will be removed in Chrome 48. See https://www.chromestatus.com/feature/5708851034718208.
will need replaced with:
https://svgwg.org/specs/paths/#InterfaceSVGPathData
there is a polyfill for this as well:
https://github.com/jarek-foksa/path-data-polyfill.js
The text was updated successfully, but these errors were encountered: