[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [34938] trunk/blender/source/blender/ editors/curve/editcurve.c: Simple re-order of first/ last point checking when adding point to

Sergey Sharybin g.ulairi at gmail.com
Thu Feb 17 20:03:13 CET 2011


Revision: 34938
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=34938
Author:   nazgul
Date:     2011-02-17 19:03:12 +0000 (Thu, 17 Feb 2011)
Log Message:
-----------
Simple re-order of first/last point checking when adding point to
NURBS spline. Need to make new point be last in array.

Beziers already has the same behaviour, so things would be more uniform now.

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	2011-02-17 18:55:17 UTC (rev 34937)
+++ trunk/blender/source/blender/editors/curve/editcurve.c	2011-02-17 19:03:12 UTC (rev 34938)
@@ -4560,22 +4560,9 @@
 	}
 	else if(!ok && nu->pntsv==1) {
 		/* which b-point? */
-		if(bp== nu->bp) {   /* first */
+		if(bp== (nu->bp+nu->pntsu-1)) {  /* last */
 			bp->f1= 0;
 			newbp =
-				(BPoint*)MEM_callocN((nu->pntsu+1) * sizeof(BPoint), "addvert_Nurb3");
-			ED_curve_bpcpy(editnurb, newbp+1, bp, nu->pntsu);
-			*newbp= *bp;
-			newbp->f1|= SELECT;
-			cu->lastsel= newbp;
-			MEM_freeN(nu->bp);
-			nu->bp= newbp;
-			bp= newbp + 1;
-			ok= 1;
-		}
-		else if(bp== (nu->bp+nu->pntsu-1)) {  /* last */
-			bp->f1= 0;
-			newbp =
 				(BPoint*)MEM_callocN((nu->pntsu+1) * sizeof(BPoint), "addvert_Nurb4");
 			ED_curve_bpcpy(editnurb, newbp, nu->bp, nu->pntsu);
 			*(newbp+nu->pntsu)= *bp;
@@ -4587,6 +4574,19 @@
 			bp= newbp - 1;
 			ok= 1;
 		}
+		else if(bp== nu->bp) {   /* first */
+			bp->f1= 0;
+			newbp =
+				(BPoint*)MEM_callocN((nu->pntsu+1) * sizeof(BPoint), "addvert_Nurb3");
+			ED_curve_bpcpy(editnurb, newbp+1, bp, nu->pntsu);
+			*newbp= *bp;
+			newbp->f1|= SELECT;
+			cu->lastsel= newbp;
+			MEM_freeN(nu->bp);
+			nu->bp= newbp;
+			bp= newbp + 1;
+			ok= 1;
+		}
 		else if(mode!='e') {
 			bp->f1= 0;
 			newbp= (BPoint*)MEM_callocN(sizeof(BPoint), "addvert_Nurb5");




More information about the Bf-blender-cvs mailing list