[Bf-blender-cvs] [ff9e0b67812] blender2.8: Fix sculpt curve stroke paint

Dalai Felinto noreply at git.blender.org
Wed Oct 17 02:41:47 CEST 2018


Commit: ff9e0b67812afcfd4d2843dfa0d8ff0cb496a2de
Author: Dalai Felinto
Date:   Tue Oct 16 21:36:22 2018 -0300
Branches: blender2.8
https://developer.blender.org/rBff9e0b67812afcfd4d2843dfa0d8ff0cb496a2de

Fix sculpt curve stroke paint

===================================================================

M	source/blender/editors/sculpt_paint/paint_cursor.c

===================================================================

diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index 0ee55f0f062..7d94e63e2bc 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -922,8 +922,11 @@ BLI_INLINE void draw_bezier_handle_lines(unsigned int pos, float sel_col[4], Bez
 	immEnd();
 }
 
-static void paint_draw_curve_cursor(Brush *brush)
+static void paint_draw_curve_cursor(Brush *brush, ViewContext *vc)
 {
+	GPU_matrix_push();
+	GPU_matrix_translate_2f(vc->ar->winrct.xmin, vc->ar->winrct.ymin);
+
 	if (brush->paint_curve && brush->paint_curve->points) {
 		int i;
 		PaintCurve *pc = brush->paint_curve;
@@ -990,6 +993,7 @@ static void paint_draw_curve_cursor(Brush *brush)
 
 		immUnbindProgram();
 	}
+	GPU_matrix_pop();
 }
 
 /* Special actions taken when paint cursor goes over mesh */
@@ -1060,7 +1064,7 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
 
 	/* skip everything and draw brush here */
 	if (brush->flag & BRUSH_CURVE) {
-		paint_draw_curve_cursor(brush);
+		paint_draw_curve_cursor(brush, &vc);
 		return;
 	}



More information about the Bf-blender-cvs mailing list