[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58576] trunk/blender/source/blender/ editors/curve/editcurve.c: correct error in last commit, tilt can be less then 0.0

Campbell Barton ideasman42 at gmail.com
Wed Jul 24 16:39:21 CEST 2013


Revision: 58576
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58576
Author:   campbellbarton
Date:     2013-07-24 14:39:21 +0000 (Wed, 24 Jul 2013)
Log Message:
-----------
correct error in last commit, tilt can be less then 0.0

Modified Paths:
--------------
    trunk/blender/source/blender/editors/curve/editcurve.c

Modified: trunk/blender/source/blender/editors/curve/editcurve.c
===================================================================
--- trunk/blender/source/blender/editors/curve/editcurve.c	2013-07-24 14:30:45 UTC (rev 58575)
+++ trunk/blender/source/blender/editors/curve/editcurve.c	2013-07-24 14:39:21 UTC (rev 58576)
@@ -2311,16 +2311,16 @@
 					last_sel = end_sel; /* before we modify it */
 
 					/* now blend between start and end sel */
-					start_rad = end_rad = -1.0;
+					start_rad = end_rad = FLT_MAX;
 
 					if (start_sel == end_sel) {
 						/* simple, only 1 point selected */
 						if (start_sel > 0)                         start_rad = BEZT_VALUE(&nu->bezt[start_sel - 1]);
 						if (end_sel != -1 && end_sel < nu->pntsu)  end_rad   = BEZT_VALUE(&nu->bezt[start_sel + 1]);
 
-						if      (start_rad >= 0.0f && end_rad >= 0.0f)  BEZT_VALUE(&nu->bezt[start_sel]) = (start_rad + end_rad) / 2.0f;
-						else if (start_rad >= 0.0f)                     BEZT_VALUE(&nu->bezt[start_sel]) = start_rad;
-						else if (end_rad >= 0.0f)                       BEZT_VALUE(&nu->bezt[start_sel]) = end_rad;
+						if      (start_rad != FLT_MAX && end_rad >= FLT_MAX) BEZT_VALUE(&nu->bezt[start_sel]) = (start_rad + end_rad) / 2.0f;
+						else if (start_rad != FLT_MAX)                       BEZT_VALUE(&nu->bezt[start_sel]) = start_rad;
+						else if (end_rad   != FLT_MAX)                       BEZT_VALUE(&nu->bezt[start_sel]) = end_rad;
 					}
 					else {
 						/* if endpoints selected, then use them */
@@ -2381,16 +2381,16 @@
 					last_sel = end_sel; /* before we modify it */
 
 					/* now blend between start and end sel */
-					start_rad = end_rad = -1.0;
+					start_rad = end_rad = FLT_MAX;
 
 					if (start_sel == end_sel) {
 						/* simple, only 1 point selected */
 						if (start_sel > 0) start_rad = BP_VALUE(&nu->bp[start_sel - 1]);
 						if (end_sel != -1 && end_sel < nu->pntsu) end_rad = BP_VALUE(&nu->bp[start_sel + 1]);
 
-						if      (start_rad >= 0.0f && end_rad >= 0.0f)  BP_VALUE(&nu->bp[start_sel]) = (start_rad + end_rad) / 2;
-						else if (start_rad >= 0.0f)                     BP_VALUE(&nu->bp[start_sel]) = start_rad;
-						else if (end_rad >= 0.0f)                       BP_VALUE(&nu->bp[start_sel]) = end_rad;
+						if      (start_rad != FLT_MAX && end_rad != FLT_MAX) BP_VALUE(&nu->bp[start_sel]) = (start_rad + end_rad) / 2;
+						else if (start_rad != FLT_MAX)                       BP_VALUE(&nu->bp[start_sel]) = start_rad;
+						else if (end_rad   != FLT_MAX)                       BP_VALUE(&nu->bp[start_sel]) = end_rad;
 					}
 					else {
 						/* if endpoints selected, then use them */




More information about the Bf-blender-cvs mailing list