diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2014-08-26 14:04:24 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2014-08-26 14:31:08 +0400 |
commit | 0e3fa0b7618fa86e97c5f46ae7208c082fd26eb7 (patch) | |
tree | 447fcae65fe6bf4086a79e03a82abb7a4138897b /source/blender/editors/include/ED_numinput.h | |
parent | 600248783b50ddef9b809b0d4c7abd9a9b20fda3 (diff) |
Fix T41590: When scene scale is not 1.0, and units are "None," Blender assumes translations are in meters.
Turned out there were several issues in handling of scale parameter by numinput.
Fixed that by factorizing more some code in common with 'usual' numbuttons eval code
(new `bUnit_getScaleUnit()` helper will return valid scaled value, depending on
given system and type).
Now, numinput behaves as expected - using default unit amended by scale in case no unit is given
(i.e. entering '20' with a scale of 0.01 will give you 20cm, and '20cm' as well!).
Diffstat (limited to 'source/blender/editors/include/ED_numinput.h')
-rw-r--r-- | source/blender/editors/include/ED_numinput.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/editors/include/ED_numinput.h b/source/blender/editors/include/ED_numinput.h index 4e96ed0c7e7..f9a22429fc2 100644 --- a/source/blender/editors/include/ED_numinput.h +++ b/source/blender/editors/include/ED_numinput.h @@ -64,6 +64,8 @@ enum { /* (1 << 9) and above are reserved for internal flags! */ }; +struct UnitSettings; + /*********************** NumInput ********************************/ /* There are important things to note here for code using numinput: @@ -76,7 +78,7 @@ enum { */ void initNumInput(NumInput *n); -void outputNumInput(NumInput *n, char *str, const float scale_length); +void outputNumInput(NumInput *n, char *str, struct UnitSettings *unit_settings); bool hasNumInput(const NumInput *n); bool applyNumInput(NumInput *n, float *vec); bool handleNumInput(struct bContext *C, NumInput *n, const struct wmEvent *event); |