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

An option to stop drag event propagation #7

Closed hagabaka closed 10 years ago

hagabaka commented 10 years ago

While dragging a propeller element, if the mouse moves over another propeller element which is a parent, the second element will start rotating. This can be confusing and frustrating. Adding event.stopPropagation(); to the end of p.onRotationStart() stops this for me (example at http://hagabaka.github.io/clock-puzzle/). I think this should be the default, or an option should be provided for this behavior.

PixelsCommander commented 10 years ago

Wow, not a trivial thing you did.

I would like to investigate this issue a bit. Could you place a not fixed instance of puzzle to clock-puzzle2 or something?

hagabaka commented 10 years ago

The unfixed version is now at http://hagabaka.github.io/clock-puzzle/original-propeller/ , and a small test case at http://hagabaka.github.io/clock-puzzle/original-propeller/nested-test.html . Try rotating the inner blue rectangle, and while the mouse button is down move over to the red rectangle.

PixelsCommander commented 10 years ago

Proposed behaviour is now by default and options.rotateParentInstantly = true can disable it.