diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2014-06-17 18:06:12 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2014-06-17 18:06:12 +0400 |
commit | fa257adf9644b7c3da28bf4041b77f49f497fb86 (patch) | |
tree | 24cf1f23f79114496b5d89d7da802d5eec3eb280 /source/blender/blenkernel/BKE_unit.h | |
parent | 94b574ee02698cc84e48210116eab474e29a8d1a (diff) |
Fix some loss of precision in BKE's unit code.
When converting text to value, units' "value" had only 6 digits of precision,
leading to annoying loss of precision esp. when mixing big and small units
(like e.g. miles and inches).
Diffstat (limited to 'source/blender/blenkernel/BKE_unit.h')
-rw-r--r-- | source/blender/blenkernel/BKE_unit.h | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/source/blender/blenkernel/BKE_unit.h b/source/blender/blenkernel/BKE_unit.h index 07aeceda474..598817298b8 100644 --- a/source/blender/blenkernel/BKE_unit.h +++ b/source/blender/blenkernel/BKE_unit.h @@ -61,17 +61,19 @@ const char *bUnit_GetNameDisplay(void *usys_pt, int index); double bUnit_GetScaler(void *usys_pt, int index); /* aligned with PropertyUnit */ -#define B_UNIT_NONE 0 -#define B_UNIT_LENGTH 1 -#define B_UNIT_AREA 2 -#define B_UNIT_VOLUME 3 -#define B_UNIT_MASS 4 -#define B_UNIT_ROTATION 5 -#define B_UNIT_TIME 6 -#define B_UNIT_VELOCITY 7 -#define B_UNIT_ACCELERATION 8 -#define B_UNIT_CAMERA 9 -#define B_UNIT_TYPE_TOT 10 +enum { + B_UNIT_NONE = 0, + B_UNIT_LENGTH = 1, + B_UNIT_AREA = 2, + B_UNIT_VOLUME = 3, + B_UNIT_MASS = 4, + B_UNIT_ROTATION = 5, + B_UNIT_TIME = 6, + B_UNIT_VELOCITY = 7, + B_UNIT_ACCELERATION = 8, + B_UNIT_CAMERA = 9, + B_UNIT_TYPE_TOT = 10, +}; #ifdef __cplusplus } |