Skip to content

Commit 34d00ee

Browse files
authored
dial.jsx -- automatic clamp
1 parent f3a4552 commit 34d00ee

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/components/direction-picker/dial.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class Dial extends React.Component {
5656
* @returns {string} Path data string for the gauge.
5757
*/
5858
gaugePath (radius, direction) {
59+
direction = ((direction + 180) % 360 + 360) % 360 - 180;
5960
const rads = (direction) * (Math.PI / 180);
6061
const path = [];
6162
path.push(`M ${radius} 0`);

0 commit comments

Comments
 (0)