Skip to content
This repository

ctx.arcTo Bug #56

Closed
apitaru opened this Issue · 2 comments

2 participants

Amit Pitaru Dominic Szablewski
Amit Pitaru

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

Amit Pitaru apitaru reopened this
Amit Pitaru

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

Dominic Szablewski
Owner

Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.