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.
This commit is contained in:
2011-02-17 19:03:12 +00:00
parent 0abc0e0468
commit 10601a70d5

View File

@@ -4560,20 +4560,7 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
}
else if(!ok && nu->pntsv==1) {
/* which b-point? */
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(bp== (nu->bp+nu->pntsu-1)) { /* last */
if(bp== (nu->bp+nu->pntsu-1)) { /* last */
bp->f1= 0;
newbp =
(BPoint*)MEM_callocN((nu->pntsu+1) * sizeof(BPoint), "addvert_Nurb4");
@@ -4587,6 +4574,19 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
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");