[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [25876] trunk/blender/source/blender/ editors/mesh/loopcut.c: Bug [#20539] Pink Opengl line should disapear

Martin Poirier theeth at yahoo.com
Sun Jan 10 20:56:22 CET 2010


Revision: 25876
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25876
Author:   theeth
Date:     2010-01-10 20:56:22 +0100 (Sun, 10 Jan 2010)

Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/mesh/loopcut.c

Modified: trunk/blender/source/blender/editors/mesh/loopcut.c
===================================================================
--- trunk/blender/source/blender/editors/mesh/loopcut.c	2010-01-10 19:35:42 UTC (rev 25875)
+++ trunk/blender/source/blender/editors/mesh/loopcut.c	2010-01-10 19:56:22 UTC (rev 25876)
@@ -103,21 +103,23 @@
 	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]);
+		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);
 	}
-	glEnd();
-
-	glPopMatrix();
-	glEnable(GL_DEPTH_TEST);
 }
 
 static void edgering_sel(tringselOpData *lcd, int previewlines, int select)
@@ -252,8 +254,13 @@
 
 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)





More information about the Bf-blender-cvs mailing list