[Bf-blender-cvs] [65e7caf] master: Fix (unreported) ED_region_tag_redraw_partial() could override a previously defined partial redraw, instead of extending it.

Bastien Montagne noreply at git.blender.org
Mon Jul 18 14:43:11 CEST 2016


Commit: 65e7caf950d94496caf3a538ddfc3cc0683fd86d
Author: Bastien Montagne
Date:   Mon Jul 18 14:37:04 2016 +0200
Branches: master
https://developer.blender.org/rB65e7caf950d94496caf3a538ddfc3cc0683fd86d

Fix (unreported) ED_region_tag_redraw_partial() could override a previously defined partial redraw, instead of extending it.

Probably not an issue currently, since partial redraw is not much used
(only from sculpt code and box-rendering it seems?), but logic was broken here.

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

M	source/blender/editors/screen/area.c

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

diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index ab8b7d4..8d058ed 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -580,15 +580,20 @@ void ED_region_tag_refresh_ui(ARegion *ar)
 void ED_region_tag_redraw_partial(ARegion *ar, const rcti *rct)
 {
 	if (ar && !(ar->do_draw & RGN_DRAWING)) {
-		if (!(ar->do_draw & RGN_DRAW)) {
+		if (!(ar->do_draw & (RGN_DRAW | RGN_DRAW_PARTIAL))) {
 			/* no redraw set yet, set partial region */
 			ar->do_draw |= RGN_DRAW_PARTIAL;
 			ar->drawrct = *rct;
 		}
 		else if (ar->drawrct.xmin != ar->drawrct.xmax) {
+			BLI_assert((ar->do_draw & RGN_DRAW_PARTIAL) != 0);
 			/* partial redraw already set, expand region */
 			BLI_rcti_union(&ar->drawrct, rct);
 		}
+		else {
+			BLI_assert((ar->do_draw & RGN_DRAW) != 0);
+			/* Else, full redraw is already requested, nothing to do here. */
+		}
 	}
 }




More information about the Bf-blender-cvs mailing list