[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36002] trunk/blender/source/blender/ editors/sculpt_paint/sculpt.c: Fix for redraw issues when making fast strokes with grab tool in sculpt mode

Sergey Sharybin g.ulairi at gmail.com
Mon Apr 4 17:15:45 CEST 2011


Revision: 36002
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36002
Author:   nazgul
Date:     2011-04-04 15:15:45 +0000 (Mon, 04 Apr 2011)
Log Message:
-----------
Fix for redraw issues when making fast strokes with grab tool in sculpt mode

Join redraw rectangles from previous step and current during one stroke
and reset previous rectangle when stroke is finished. This shouldn't cause problems
with viewport changes during the sculpt session and this should emulate
object boundbox merging for states "before step" and "after step".

At leastm it's more logical because boundbox could not only grow up during
stroke, but it could also shrink down.

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

Modified: trunk/blender/source/blender/editors/sculpt_paint/sculpt.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/sculpt.c	2011-04-04 15:13:37 UTC (rev 36001)
+++ trunk/blender/source/blender/editors/sculpt_paint/sculpt.c	2011-04-04 15:15:45 UTC (rev 36002)
@@ -263,6 +263,8 @@
 	int alt_smooth;
 
 	float plane_trim_squared;
+
+	rcti previous_r; /* previous redraw rectangle */
 } StrokeCache;
 
 /*** BVH Tree ***/
@@ -3403,19 +3405,19 @@
 
 		BLI_pbvh_update(ss->pbvh, PBVH_UpdateBB, NULL);
 		if (sculpt_get_redraw_rect(ar, CTX_wm_region_view3d(C), ob, &r)) {
-			//rcti tmp;
-
 			r.xmin += ar->winrct.xmin + 1;
 			r.xmax += ar->winrct.xmin - 1;
 			r.ymin += ar->winrct.ymin + 1;
 			r.ymax += ar->winrct.ymin - 1;
 
-			//tmp = r;
+			if (ss->cache) {
+				rcti tmp = r;
 
-			//if (!BLI_rcti_is_empty(&ss->previous_r))
-			//	BLI_union_rcti(&r, &ss->previous_r);
+				if (!BLI_rcti_is_empty(&ss->cache->previous_r))
+					BLI_union_rcti(&r, &ss->cache->previous_r);
 
-			//ss->previous_r= tmp;
+				ss->cache->previous_r= tmp;
+			}
 
 			ss->partial_redraw = 1;
 			ED_region_tag_redraw_partial(ar, &r);




More information about the Bf-blender-cvs mailing list