[Bf-blender-cvs] [350457e] wiggly-widgets: Fix selected widget drawn twice on mouse hover

Julian Eisel noreply at git.blender.org
Sun Nov 15 22:29:30 CET 2015


Commit: 350457e8cf5ec1a7638fd0b12b618ad8b39962b7
Author: Julian Eisel
Date:   Sun Nov 15 22:28:45 2015 +0100
Branches: wiggly-widgets
https://developer.blender.org/rB350457e8cf5ec1a7638fd0b12b618ad8b39962b7

Fix selected widget drawn twice on mouse hover

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

M	source/blender/windowmanager/intern/wm_widgets.c

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

diff --git a/source/blender/windowmanager/intern/wm_widgets.c b/source/blender/windowmanager/intern/wm_widgets.c
index 38417c2..bd3a030 100644
--- a/source/blender/windowmanager/intern/wm_widgets.c
+++ b/source/blender/windowmanager/intern/wm_widgets.c
@@ -249,9 +249,9 @@ void WM_widgets_update(const bContext *C, wmWidgetMap *wmap)
 	if (!wmap)
 		return;
 
-	widget = wmap->wmap_context.active_widget;
-
-	if (widget) {
+	if ((widget = wmap->wmap_context.selected_widget) ||
+	    (widget = wmap->wmap_context.active_widget))
+	{
 		widget_calculate_scale(widget, C);
 	}
 	else if (wmap->widgetgroups.first) {
@@ -360,6 +360,7 @@ void WM_widgets_draw(const bContext *C, const wmWidgetMap *wmap, const bool in_s
 				for (widget = wgroup->widgets.first; widget; widget = widget->next) {
 					if ((widget->flag & WM_WIDGET_HIDDEN) == 0 &&
 					    (!(widget->flag & WM_WIDGET_DRAW_HOVER) || (widget->flag & WM_WIDGET_HIGHLIGHT)) &&
+					    ((widget->flag & WM_WIDGET_SELECTED) == 0) && /* selected is drawn later */
 					    ((widget->flag & WM_WIDGET_SCENE_DEPTH) != 0) == in_scene)
 					{
 						widget->draw(C, widget);




More information about the Bf-blender-cvs mailing list