svgdotjs / svg.topoly.js

A plugin for SVG.js to convert paths to polygons at a given sample rate

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cubic Bezier curves not handled correctly?

peteruithoven opened this issue · comments

I found is that Cubic bezier curves seem to be handled incorrectly, they are handled as straight lines by getPointAtLength.
A simple example:

var container = document.getElementById("container");
var svg = SVG("container").size("100%","100%");

var path = svg.path('M34.5,45.5 c0,0,38-43,71-18 s31,81 20,78 c0,0,38-43,71-18 s31,81-20,78 -16-47-16-47');
var poly = path.toPoly("1%").stroke({color:'#F00'}).fill("none");

I just noticed that this happens in Firefox, but it works fine in Chrome and Safari.

commented

Yeah, FireFox always seems to handle things differently which can be quite annoying. Nothing I can do here I'm afraid because that's the native api.

I've posted it on https://support.mozilla.org/ (I couldn't find another issue queue for Firefox)

commented

Great!

Just a question, how does the example.html look with you in FireFox?
Because here it looks just fine in FF 27.0.1 (OSX):

screen shot 2014-07-27 at 16 55 25

But FF 30.0 is much more edged:

screen shot 2014-07-27 at 16 54 36

The S looks like this for me, in Firefox 30.0
screen shot 2014-07-28 at 10 45 53

But my example looks like this:
screen shot 2014-07-28 at 10 45 50

While it looks like this in Chrome (which is how it should look):
screen shot 2014-07-28 at 10 47 33

commented

Obviously it's a FF issue as older version did do it properly. Hopefully they can fix it soon...