Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-02-28 12:36:02 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-02-28 12:36:02 +0300
commit5369bd9c216243c4122d03896a3f7982631a4abf (patch)
tree46d920fdd4d44071d4e9e64b1759d9203fed2f6e /source/blender/blenkernel/intern/unit.c
parent67af290bd125c181a1a851286da0677c7d5a1dbd (diff)
- 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)
Diffstat (limited to 'source/blender/blenkernel/intern/unit.c')
-rw-r--r--source/blender/blenkernel/intern/unit.c3
1 files changed, 1 insertions, 2 deletions
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;