Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(WIP) Graphics - add ellipticalArc method #1544

Open
wants to merge 2 commits into
base: dev-3.x
Choose a base branch
from

Conversation

tripp
Copy link
Contributor

@tripp tripp commented Jan 11, 2014

First pass at fixing #1443.
Created ellipticalArc method based on w3c elliptical arc implementation notes.

Added manual example based on this example in the path spec.

Currently, VML/Canvas implementations are drawing arcs by point. May consider using cubic bezier approximations depending on performance.

  • Add unit tests.
  • Cross browser/platform testing
  • Perf testing.
  • Update based on any feedback.

	modified:   js/CanvasDrawing.js
	modified:   js/SVGDrawing.js
	modified:   js/VMLDrawing.js

//step 1: compute x and y derivatives
x1_ = (cosTheta * (x1 - x2)/2) + (sinTheta * (y1 - y2)/2);
y1_ = (-sinTheta * (x1 - x2)/2) + (cosTheta * (y1 - y2)/2);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 321-322:

You don't have to divide by 2 twice. Factor it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants