diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-02-16 00:07:14 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-02-16 00:07:14 +0300 |
commit | 88a2f63c1efe0966f42943e74893e06361184795 (patch) | |
tree | 8289ac28daee1c6478e39c64770b5ca72bf64a67 /source/blender | |
parent | e9313749a1c1e9491d100a80ead1496d9f900162 (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')
-rw-r--r-- | source/blender/blenkernel/intern/unit.c | 8 | ||||
-rw-r--r-- | source/blender/editors/interface/interface.c | 6 |
2 files changed, 9 insertions, 5 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; } diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index d6357f392b5..ea7e89f5102 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1253,7 +1253,11 @@ int ui_is_but_unit(uiBut *but) if (scene->unit.flag & USER_UNIT_ROT_RADIANS && unit_type == PROP_UNIT_ROTATION) return 0; - + + /* for now disable time unit conversion */ + if (unit_type == PROP_UNIT_TIME) + return 0; + if (scene->unit.system == USER_UNIT_NONE) { if (unit_type != PROP_UNIT_ROTATION) return 0; |