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

+ onMouseLeave param #14

Open tetreum opened 9 years ago

tetreum commented 9 years ago

DO NOT MERGE THIS PULL REQUEST

This is what i'm using to be able to rotate an object without having to mouse over it. The problem is that would crash on "jquery zero-dependancy". I only made the pull request to show my idea and maybe implement it in a better way.

PixelsCommander commented 9 years ago

Hello

Could you elaborate on case you faced? This sounds a bit unexpected and confusing. Is this http://pixelscommander.com/polygon/twopropellers/ something you want to have? Controlling one element by another?

mattwright324 commented 4 years ago

I experienced the same issue and this change by @tetreum is almost perfect.

To elaborate on the issue, you are unable to rotate/propel an element when the mouse leaves the element ... fires onStop. This means smaller elements like 40x40 (unlike the very large propellers in your examples) that can be difficult to stay inside of are difficult to rotate/propel.

However, this change isn't perfect because it continues to rotate/move with the mouse while outside the element when you had let off on holding the mouse. The only way to stop it is to go back and click on the element.

mattwright324 commented 4 years ago

The problem I faced is easily fixed by adding $(document).on('mouseup.propeller', this.onRotationStop); to the addListeners section where he had added listening to mousemove.propeller.