From 5369bd9c216243c4122d03896a3f7982631a4abf Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 28 Feb 2010 09:36:02 +0000 Subject: - template with an example of a modal operator drawing with opengl (draw a line on the screen) - access to event.mouse_region_x/y - basic type checking to callback functions (use PyCapsule names) --- source/blender/blenkernel/intern/unit.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source/blender/blenkernel/intern/unit.c') diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c index a16c1956cc4..87424dda04d 100644 --- a/source/blender/blenkernel/intern/unit.c +++ b/source/blender/blenkernel/intern/unit.c @@ -170,8 +170,7 @@ static void unit_dual_convert(double value, bUnitCollection *usys, { bUnitDef *unit= unit_best_fit(value, usys, NULL, 1); - if(value < 0.0) *value_a= -floor(-value/unit->scalar) * unit->scalar; - else *value_a= floor( value/unit->scalar) * unit->scalar; + *value_a= (value < 0.0 ? ceil:floor)(value/unit->scalar) * unit->scalar; *value_b= value - (*value_a); *unit_a= unit; -- cgit v1.2.3