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>2010-02-16 00:07:14 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-02-16 00:07:14 +0300
commit88a2f63c1efe0966f42943e74893e06361184795 (patch)
tree8289ac28daee1c6478e39c64770b5ca72bf64a67 /source/blender/blenkernel/intern/unit.c
parente9313749a1c1e9491d100a80ead1496d9f900162 (diff)
bugfix [#21136] End frame And Cur Frame setting is broken with Metric/Imperial units [26876]
and minor changes for unit.c, no functional change.
Diffstat (limited to 'source/blender/blenkernel/intern/unit.c')
-rw-r--r--source/blender/blenkernel/intern/unit.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c
index 7d01c7ecc66..9d18c35984b 100644
--- a/source/blender/blenkernel/intern/unit.c
+++ b/source/blender/blenkernel/intern/unit.c
@@ -24,8 +24,8 @@
#include <stdio.h>
#include <ctype.h>
#include <string.h>
+#include <math.h>
-#include "BLI_math.h"
#include "BLI_winstuff.h"
#define TEMP_STR_SIZE 256
@@ -33,7 +33,7 @@
#define SEP_CHR '#'
#define SEP_STR "#"
-#define EUL 0.000001
+#define EPS 0.000001
/* define a single unit */
@@ -118,7 +118,7 @@ static struct bUnitCollection buNaturalTimeCollecton = {buNaturalTimeDef, 3, 0,
static struct bUnitDef buNaturalRotDef[] = {
- {"degree", "degrees", "°", NULL, "Degrees", M_PI/180.f, 0.0, B_UNIT_DEF_NONE},
+ {"degree", "degrees", "°", NULL, "Degrees", M_PI/180.0, 0.0, B_UNIT_DEF_NONE},
{NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
};
static struct bUnitCollection buNaturalRotCollection = {buNaturalRotDef, 0, 0, sizeof(buNaturalRotDef)/sizeof(bUnitDef)};
@@ -152,7 +152,7 @@ static bUnitDef *unit_best_fit(double value, bUnitCollection *usys, bUnitDef *un
if(suppress && (unit->flag & B_UNIT_DEF_SUPPRESS))
continue;
- if (value_abs >= unit->scalar*(1.0-EUL)) /* scale down scalar so 1cm doesnt convert to 10mm because of float error */
+ if (value_abs >= unit->scalar*(1.0-EPS)) /* scale down scalar so 1cm doesnt convert to 10mm because of float error */
return unit;
}