Closed seanjensengrey closed 10 years ago
Interesting! I assume you're seeing something like this?
I see that under iOS and OS X using Chrome but it renders properly on my Windows 7 machine using Chrome. I'll definitely look into this this weekend. Thanks for reporting it!
Actually, the browser gives us a useful error message: Error: Failed to execute 'arc' on 'CanvasRenderingContext2D': The radius provided (-22.5) is negative.
Seems that some graphics drivers will not do that. I will check for a negative radius in the arc function and handle it appropriately.
I was just about to say the same. Looking into it further, Chrome is behaving correctly here; the spec does say:
Negative values for radiusX or radiusY must cause the implementation to throw an IndexSizeError exception.
Good news and bad news:
The good news is that that fiddle is now working.
The bad news is that I still have not entirely fixed the issue that this has exposed. The disconnect between the 2D Canvas implementation of arc drawing and Love's method (which is just to draw a series of lines and then use a triangle fan) results in an awful lot of edge cases. I'm going to leave this on the fix_arc
branch until I can come up with a more satisfying solution. The relevant commit is here: a4e79f6c9d6ff21fe7477b06d0cf1946de4566a7
Resolved via #44.
http://lovefiddle.com/78b2f46d0e47efc495dd13b63f7e09cc66afa2fa