Fix #28695: path/beziercirlce defined surface dissapears when deleting subdv of path...
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 22 Sep 2011 12:07:02 +0000 (12:07 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 22 Sep 2011 12:07:02 +0000 (12:07 +0000)
Clamp order when deleting points from nurb curve.
Also fixed incorrect free caused by non-initialized knots array
when deleting segment from non-cyclic nurb.

source/blender/editors/curve/editcurve.c

index 75188411f4122a0a7abbadf0a6ea3bfae9e4c618..91c06e0f125e590b951b76423ff6aad74cc826e2 100644 (file)
@@ -5777,6 +5777,7 @@ static int delete_exec(bContext *C, wmOperator *op)
                                                clamp_nurb_order_u(nu);
                                        }*/
                                }
+                               clamp_nurb_order_u(nu);
                                nurbs_knot_calc_u(nu);
                        }
                        nu= next;
@@ -5925,7 +5926,14 @@ static int delete_exec(bContext *C, wmOperator *op)
                                        MEM_freeN(nu1->bp);
                                        nu1->bp= bp;
                                        nu1->pntsu= a;
+                                       nu1->knotsu= NULL;
                                        nu->pntsu= cut+1;
+
+                                       clamp_nurb_order_u(nu);
+                                       nurbs_knot_calc_u(nu);
+
+                                       clamp_nurb_order_u(nu1);
+                                       nurbs_knot_calc_u(nu1);
                                }
                        }
                }