Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

ctx.arcTo Bug #56

Closed
apitaru opened this Issue Nov 6, 2012 · 2 comments

Comments

Projects
None yet
2 participants

apitaru commented Nov 6, 2012

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 apitaru closed this Nov 6, 2012

@apitaru apitaru reopened this Nov 8, 2012

apitaru commented Nov 8, 2012

(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.

@phoboslab phoboslab closed this in 231d8aa Nov 9, 2012

Owner

phoboslab commented Nov 9, 2012

Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment