[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58902] branches/soc-2013-paint/source/ blender/editors/sculpt_paint/paint_stroke.c: Modify polyline drawing to make the last line segment dotted.

Antony Riakiotakis kalast at gmail.com
Sun Aug 4 16:04:31 CEST 2013


Revision: 58902
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58902
Author:   psy-fi
Date:     2013-08-04 14:04:31 +0000 (Sun, 04 Aug 2013)
Log Message:
-----------
Modify polyline drawing to make the last line segment dotted. This
signifies that it won't be used for the final stroke. Also reset line
width value, this made the lines in the UI thicker when using line
strokes.

Modified Paths:
--------------
    branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_stroke.c

Modified: branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_stroke.c
===================================================================
--- branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_stroke.c	2013-08-04 14:04:23 UTC (rev 58901)
+++ branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_stroke.c	2013-08-04 14:04:31 UTC (rev 58902)
@@ -137,7 +137,6 @@
 	}
 }
 
-/*** Cursors ***/
 static void paint_draw_line_cursor(bContext *C, int UNUSED(x), int UNUSED(y), void *customdata)
 {
 	Paint *paint = BKE_paint_get_active_from_context(C);
@@ -150,7 +149,7 @@
 		glEnable(GL_LINE_SMOOTH);
 		glEnable(GL_BLEND);
 
-		while (p->next) {
+		while (p->next && p->next->next) {
 			glColor4ub(0, 0, 0, paint->paint_cursor_col[3]);
 			glLineWidth(4.0);
 			sdrawline((int)p->pos[0], (int)p->pos[1],
@@ -164,6 +163,28 @@
 			p = p->next;
 		}
 
+		if (p->next) {
+			if (brush->flag & BRUSH_POLYLINE)
+			{
+				glEnable(GL_LINE_STIPPLE);
+				glLineStipple(3, 0xAAAA);
+			}
+
+			glColor4ub(0, 0, 0, paint->paint_cursor_col[3]);
+			glLineWidth(4.0);
+			sdrawline((int)p->pos[0], (int)p->pos[1],
+			          (int)p->next->pos[0], (int)p->next->pos[1]);
+
+			glColor4ubv(paint->paint_cursor_col);
+			glLineWidth(2.0);
+			sdrawline((int)p->pos[0], (int)p->pos[1],
+			          (int)p->next->pos[0], (int)p->next->pos[1]);
+
+			glDisable(GL_LINE_STIPPLE);
+		}
+
+		glLineWidth(1.0);
+
 		glDisable(GL_BLEND);
 		glDisable(GL_LINE_SMOOTH);
 	}




More information about the Bf-blender-cvs mailing list