diff options
-rw-r--r-- | source/blender/editors/mesh/loopcut.c | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/source/blender/editors/mesh/loopcut.c b/source/blender/editors/mesh/loopcut.c index 9fea0d08e70..9510e40c6ac 100644 --- a/source/blender/editors/mesh/loopcut.c +++ b/source/blender/editors/mesh/loopcut.c @@ -103,21 +103,23 @@ static void ringsel_draw(const bContext *C, ARegion *ar, void *arg) int i; tringselOpData *lcd = arg; - glDisable(GL_DEPTH_TEST); + if (lcd->totedge > 0) { + glDisable(GL_DEPTH_TEST); - glPushMatrix(); - glMultMatrixf(lcd->ob->obmat); + glPushMatrix(); + glMultMatrixf(lcd->ob->obmat); - glColor3ub(255, 0, 255); - glBegin(GL_LINES); - for (i=0; i<lcd->totedge; i++) { - glVertex3fv(lcd->edges[i][0]); - glVertex3fv(lcd->edges[i][1]); - } - glEnd(); + glColor3ub(255, 0, 255); + glBegin(GL_LINES); + for (i=0; i<lcd->totedge; i++) { + glVertex3fv(lcd->edges[i][0]); + glVertex3fv(lcd->edges[i][1]); + } + glEnd(); - glPopMatrix(); - glEnable(GL_DEPTH_TEST); + glPopMatrix(); + glEnable(GL_DEPTH_TEST); + } } static void edgering_sel(tringselOpData *lcd, int previewlines, int select) @@ -252,8 +254,13 @@ static void edgering_sel(tringselOpData *lcd, int previewlines, int select) static void ringsel_find_edge(tringselOpData *lcd, const bContext *C, ARegion *ar, int cuts) { - if (lcd->eed) + if (lcd->eed) { edgering_sel(lcd, cuts, 0); + } else { + MEM_freeN(lcd->edges); + lcd->edges = NULL; + lcd->totedge = 0; + } } static void ringsel_finish(bContext *C, wmOperator *op) |