diff options
author | Martin Poirier <theeth@yahoo.com> | 2010-01-10 22:56:22 +0300 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2010-01-10 22:56:22 +0300 |
commit | 0bd98195a1d67ce741145a39147cf8272708f5a2 (patch) | |
tree | 790d2222884f1827f3c51523483c71a8597a9c3c | |
parent | 580345394eb58748fa6df527a095671ed3edc396 (diff) |
Bug [#20539] Pink Opengl line should disapear
Reset edge loop data when there are no edge near (it doesn't cut when there's no edge near anyway, so the display was missleading)
Also don't do any display setup when there's nothing to display.
-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) |