patch [#23796] Full support for unit buttons: area, volume, mass, velocity and accele...
authorCampbell Barton <ideasman42@gmail.com>
Wed, 22 Sep 2010 02:44:03 +0000 (02:44 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 22 Sep 2010 02:44:03 +0000 (02:44 +0000)
from Lorenzo Tozzi (oni_niubbo), multiple patches: better_split.diff

source/blender/blenkernel/intern/unit.c

index 75be48cc8856b86e79d6aec637bc42e4faa53a1f..de22a0e347c5053e2eef632b85de690cf8d399eb 100644 (file)
@@ -395,8 +395,9 @@ void bUnit_AsString(char *str, int len_max, double value, int prec, int system,
 
        if(usys==NULL || usys->units[0].name==NULL)
                usys= &buDummyCollecton;
-
-       if(split) {
+   
+       /* split output makes sense only for length, mass and time */
+       if(split && (type==B_UNIT_LENGTH || type==B_UNIT_MASS || type==B_UNIT_TIME)) {
                int i;
                bUnitDef *unit_a, *unit_b;
                double value_a, value_b;