From bec3d213074e870305777d6d97ea415a4c0018a8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 27 Feb 2010 23:22:10 +0000 Subject: [PATCH] bugfix [#21381] Wrong negative separated units --- source/blender/blenkernel/intern/unit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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;