diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-02-28 02:22:10 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-02-28 02:22:10 +0300 |
commit | bec3d213074e870305777d6d97ea415a4c0018a8 (patch) | |
tree | 5948f73058c36eb43e7528681589a75212334c01 /source/blender/blenkernel | |
parent | 5c87e0580f3173fdcd83cc2b4dbe4f5ef2d924a5 (diff) |
bugfix [#21381] Wrong negative separated units
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/unit.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c index 22dc5a15650..a16c1956cc4 100644 --- a/source/blender/blenkernel/intern/unit.c +++ b/source/blender/blenkernel/intern/unit.c @@ -170,7 +170,8 @@ static void unit_dual_convert(double value, bUnitCollection *usys, { bUnitDef *unit= unit_best_fit(value, usys, NULL, 1); - *value_a= floor(value/unit->scalar) * unit->scalar; + if(value < 0.0) *value_a= -floor(-value/unit->scalar) * unit->scalar; + else *value_a= floor( value/unit->scalar) * unit->scalar; *value_b= value - (*value_a); *unit_a= unit; |