Ejecta icon indicating copy to clipboard operation
Ejecta copied to clipboard

ctx.arcTo Bug

Open apitaru opened this issue 14 years ago • 2 comments

While trying to port a few vector drawings into ejecta, I noticed that arcTo() is not drawing predictably.

A simple example is here: http://www.html5canvastutorials.com/tutorials/html5-canvas-rounded-corners/

In this example Ejecta will not draw the curve at all, making me thing that in arcToX1 "if( mm < 1.0e-8 || radius == 0 )" is inaccurately returning true. But more sophisticated drawings will cause it to shoot lines in unpredictable directions, so I think one of the base variables might be wrong.

I also looked at the original code that you mention arcToX1 is taken from ( http://code.google.com/p/fxcanvas/source/search?q=1.0e-8&origq=1.0e-8&btnG=Search+Trunk ), and I wonder if your "cp" variable is getting the right values from:

EJVector2 cp = EJVector2ApplyTransform(EJVector2Make(x1, y1), CGAffineTransformInvert(transform));

Sorry I can't be more descriptive - I'm humbled by the math there : )

Amit

apitaru avatar Nov 06 '12 23:11 apitaru

(btw - a few days ago i created a duplicate issue. github doesn't allow to delete them, so i'm "recycling" it with a new topic. sorry about that. never again.

apitaru avatar Nov 08 '12 18:11 apitaru

Thanks for reporting!

phoboslab avatar Nov 09 '12 21:11 phoboslab