diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-03-13 21:16:49 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-03-13 21:16:49 +0400 |
commit | 5162a155afe279519ad353312307ab5496c16603 (patch) | |
tree | 6f9be06f9c23d90093d610bf07dc74cad1ef1107 /source/blender/editors/interface/interface.c | |
parent | a3ad35cf3a3a28ee51c30b88bc439af8dce9f7e4 (diff) |
Fix #34481: camera focal length and sensor size did not use units yet, now they do.
I've added a separate camera unit type. It's a bit strange to have an exception for
this but it ensures units are shown in familiar millimeters and it also ensures
backwards compatibility.
Diffstat (limited to 'source/blender/editors/interface/interface.c')
-rw-r--r-- | source/blender/editors/interface/interface.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 9c1cdad4d0a..20233a67775 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1646,6 +1646,9 @@ static double ui_get_but_scale_unit(uiBut *but, double value) if (unit_type == PROP_UNIT_LENGTH) { return value * (double)unit->scale_length; } + else if (unit_type == PROP_UNIT_CAMERA) { + return value * (double)unit->scale_length; + } else if (unit_type == PROP_UNIT_AREA) { return value * pow(unit->scale_length, 2); } |