[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [56448] trunk/blender/source/blender/ editors/sculpt_paint/paint_stroke.c: Fix missing brush cursor redraw for texture paint when no pixels changed in the

Brecht Van Lommel brechtvanlommel at pandora.be
Wed May 1 16:59:51 CEST 2013


Revision: 56448
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56448
Author:   blendix
Date:     2013-05-01 14:59:50 +0000 (Wed, 01 May 2013)
Log Message:
-----------
Fix missing brush cursor redraw for texture paint when no pixels changed in the
image, no images need to be refreshed then but the cursors needs to be redrawn
still. Otherwise it gets stuck, especially annoying in unexpected cases where the
mask has reached the maximum for all pixels in the brush.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/sculpt_paint/paint_stroke.c

Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_stroke.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_stroke.c	2013-05-01 14:34:12 UTC (rev 56447)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_stroke.c	2013-05-01 14:59:50 UTC (rev 56448)
@@ -255,6 +255,7 @@
 static void paint_brush_stroke_add_step(bContext *C, wmOperator *op, const wmEvent *event, const float mouse_in[2])
 {
 	Scene *scene = CTX_data_scene(C);
+	ARegion *ar = CTX_wm_region(C);
 	Paint *paint = BKE_paint_get_active_from_context(C);
 	PaintMode mode = BKE_paintmode_get_active_from_context(C);
 	Brush *brush = BKE_paint_brush(paint);
@@ -324,6 +325,10 @@
 	RNA_float_set(&itemptr, "pressure", pressure);
 
 	stroke->update_step(C, stroke, &itemptr);
+
+	/* always redraw region if brush is shown */
+	if (ar && (paint->flags & PAINT_SHOW_BRUSH))
+		ED_region_tag_redraw(ar);
 }
 
 /* Returns zero if no sculpt changes should be made, non-zero otherwise */




More information about the Bf-blender-cvs mailing list