diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-02-17 22:03:12 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-02-17 22:03:12 +0300 |
commit | 10601a70d52d8af3542c0d944ba6842162c52fdb (patch) | |
tree | 9e4822c6dd5adaa1b4b3013830bd98e8e6df41f7 | |
parent | 0abc0e0468f0cb384f11eed4bf72f6d6cbc8eff8 (diff) |
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.
-rw-r--r-- | source/blender/editors/curve/editcurve.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 1e551b64693..857a461e26e 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -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"); |