PixelsCommander / Propeller

JavaScript library to rotate elements with mouse or touch gestures. Supports inertia and stepwise rotation. Optimized for better performance.
http://pixelscommander.com/polygon/propeller/
409 stars 58 forks source link

Initial angle doesn't work #6

Closed ziethan closed 10 years ago

ziethan commented 10 years ago

I went through the code and noticed that there is an angle option for the option object but the angle always resets to 0 no matter what is set in the option object. Is there an easy work around or something that could be fixed?

PixelsCommander commented 10 years ago

Try adding this.angle = options.angle || 0; to p.initOptions

hagabaka commented 10 years ago

It seems that adding the above code is not necessary, but instead you have to call propeller.updateCSS() after initializing it with an angle option. (I think you have to use the new Propeller(node, options) syntax instead of $node.propeller(options) syntax to get the Propeller instance).

hagabaka commented 10 years ago

I also noticed that while attempting to set propeller.angle doesn't do anything, setting propeller.virtualAngle does. Is this intended? If so it deserves to be in the documentation.

PixelsCommander commented 10 years ago

There was no possibility to set angle from outside by design, at the moment it is still a feature to add

PixelsCommander commented 10 years ago

Think the easiest way to fix virtualAngle/angle issue is to add setter on angle property