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

Added "spiral" and "center path" options for the Arc path, rotation support #14

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

DanielSchaffer
Copy link

I added two optional features when using the Arc path:

  • specify a "spiral" option instead of "radius". The array should have two numeric elements, representing the starting and ending radius, respecively
  • specify another path object for the "center" option. It will be used the calculate the center for each step of the path

I also added better support for rotating the element.

  • IMPORTANT: Rotation requires that the "transform" css hook is present (from https://github.com/brandonaaron/jquery-cssHooks/blob/master/transform.js). This is a carryover from the existing rotation functionality, which doesn't document the requirement. I'm not sure if there's a better way to support this.
  • The existing rotation algorithm was refactored into the 'followPath' rotator.
  • Added a 'spin' rotator that works similar to the arc path.
  • Rotators should be added to the $.path.rotators object
  • A rotator must:
    • have a 'rotate' function that returns a numeric value
    • have a 'unit' property whose value is one of the supported css transform-rotate units (deg, rad, grad, turn). These values are also available from the $.path.rotators.units object
  • in the step function, if the path object ('end') contains a valid rotator and the transform css hook is detected, it will call the 'rotate' function and set the css transform to rotate to the value and unit specified by the rotator. it passes in 'p', the position; 'css', the css object generated by the path object; and 'prevState', the state of the path object before the css() function was called.

@DanielSchaffer
Copy link
Author

Ogh ... sorry about all the whitespace changes. I thought I'd fixed it, I guess I still don't have Sublime configured correctly.

…ithm into 'followPath' rotator; added 'spin' rotator
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.

None yet

1 participant