Commit: c77da24116991e1c6c5911e5bc99aa66178e0e7c
Author: Sergey Sharybin
Date:   Thu Sep 22 10:04:51 2016 +0200
Branches: master
https://developer.blender.org/rBc77da24116991e1c6c5911e5bc99aa66178e0e7c

Fix non-finite normalization factor in certain cases

===================================================================

M       source/blender/editors/animation/anim_draw.c

===================================================================

diff --git a/source/blender/editors/animation/anim_draw.c 
b/source/blender/editors/animation/anim_draw.c
index dbc9c8b..f8b98eb 100644
--- a/source/blender/editors/animation/anim_draw.c
+++ b/source/blender/editors/animation/anim_draw.c
@@ -343,12 +343,13 @@ static float normalization_factor_get(Scene *scene, 
FCurve *fcu, short flag, flo
                        }
                }
 
-               range = max_coord - min_coord;
-
-               if (range > FLT_EPSILON) {
-                       factor = 2.0f / range;
+               if (max_coord > min_coord) {
+                       range = max_coord - min_coord;
+                       if (range > FLT_EPSILON) {
+                               factor = 2.0f / range;
+                       }
+                       offset = -min_coord - range / 2.0f;
                }
-               offset = -min_coord - range / 2.0f;
        }
        BLI_assert(factor != 0.0f);
        if (r_offset) {

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to