Skip to content

Conversation

@mal
Copy link
Contributor

@mal mal commented Nov 3, 2013

Fixes #105

Creates the rotation option that allows a setting of anticlockwise (or acw) to reverse the direction of progression used by the knob. It fully supports the clicking/touching and displayPrevious functionality.

To facilitate extending this behavior to custom draw functions, arc calculations have been factored out of draw into an arc function, which returns the start and end angles, and a boolean denoting the direction of the stroke.

I've tested it successfully using all of the examples founds on index.html and have added the option to one of the existing examples.

Tested in: Firefox 26, Chrome 32 and on Android 4.4 (Chrome).

@andfinally
Copy link

Thanks mal, this is a very useful option - just the thing I was after! It would be nice (and consistent) if the direction value could also be passed in the options object when initialising knob() - for me this is just working when it's a data attribute on the input.

@mal
Copy link
Contributor Author

mal commented Jan 26, 2014

Thanks @andfinally, I hadn't realised that didn't work. I've fixed it now, and also changed the setting name to rotation and added support for shorthand (anticlockwise and acw will both do the job).

mal added 3 commits January 26, 2014 13:42
Fixes aterrien#105

Creates the `rotation` option that allows a setting of `anticlockwise`
(or 'acw') to reverse the direction of progression used by the knob. It
fully supports the clicking/touching and `displayPrevious`
functionality.

To facilitate extending this behavior to custom draw functions, arc
calculations have been factored out of `draw` into an `arc` function,
which returns the start and end angles, and a boolean denoting the
direction of the stroke.
@andfinally
Copy link

Great, thanks!

@HugoHeneault
Copy link

Any possibility to see this pull merged ?

@mal
Copy link
Contributor Author

mal commented Mar 4, 2014

@aterrien any pointers for making this acceptable for merging?

@aterrien aterrien merged commit 3ef3110 into aterrien:master Mar 4, 2014
@aterrien
Copy link
Owner

aterrien commented Mar 4, 2014

Thank you @mal (sorry, I was in the outer space).

@mal
Copy link
Contributor Author

mal commented Mar 4, 2014

Thanks! 😀

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.

Add option to choose direction

4 participants