Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-08-29 09:35:19 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-08-29 09:35:19 +0400
commit8a215669e8668b81610903a80a0c11e1cf64ccac (patch)
tree8f36c005b3d3327c46cea7240feb5a1437020fd4 /source/blender/blenlib/intern/BLI_dial.c
parent1dddad93c45bb29e001afe21e24ae1f34aaa3e7f (diff)
Cleanup
Diffstat (limited to 'source/blender/blenlib/intern/BLI_dial.c')
-rw-r--r--source/blender/blenlib/intern/BLI_dial.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/blenlib/intern/BLI_dial.c b/source/blender/blenlib/intern/BLI_dial.c
index 943e0b2bf99..cfbb52847fd 100644
--- a/source/blender/blenlib/intern/BLI_dial.c
+++ b/source/blender/blenlib/intern/BLI_dial.c
@@ -46,7 +46,7 @@ struct Dial {
};
-Dial * BLI_dial_initialize(float start_position[2], float threshold)
+Dial *BLI_dial_initialize(float start_position[2], float threshold)
{
Dial *dial = MEM_callocN(sizeof(Dial), "dial");
@@ -79,13 +79,14 @@ float BLI_dial_angle(Dial *dial, float current_position[2])
sinval = cross_v2v2(current_direction, dial->initial_direction);
/* clamp to avoid nans in acos */
- angle = atan2(sinval, cosval);
+ angle = atan2f(sinval, cosval);
/* change of sign, we passed the 180 degree threshold. This means we need to add a turn.
* to distinguish between transition from 0 to -1 and -PI to +PI, use comparison with PI/2 */
- if ((angle * dial->last_angle < 0.0f) && (fabsf(dial->last_angle) > (float)M_PI_2))
+ if ((angle * dial->last_angle < 0.0f) &&
+ (fabsf(dial->last_angle) > (float)M_PI_2))
{
- if (dial->last_angle < 0)
+ if (dial->last_angle < 0.0f)
dial->rotations--;
else
dial->rotations++;