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

Is it possible to restrict the rotation between degrees? #18

Closed blastframe closed 7 years ago

blastframe commented 8 years ago

Hello, Excellent work here!

Is there a way to restrict the rotation of a propeller between, say, 300° and 45°? If there is inertia, will it bounce off of the boundary?

PixelsCommander commented 8 years ago

There is no way to set boundaries. Simpliest way of implementing this is to listen to onrotate and operate with this.angle from there. Also you may modify sources and introduce new API like deadZone.start / deadZone.end. Feel free to make a PR or ask me if need any help.