[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55236] trunk/blender/source/blender/ editors/interface/interface_handlers.c: Fix wrong use of enum in UI code to reactive button on mouse over, this worked

Brecht Van Lommel brechtvanlommel at pandora.be
Wed Mar 13 15:19:53 CET 2013


Revision: 55236
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55236
Author:   blendix
Date:     2013-03-13 14:19:53 +0000 (Wed, 13 Mar 2013)
Log Message:
-----------
Fix wrong use of enum in UI code to reactive button on mouse over, this worked
only by accident.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/interface/interface_handlers.c

Modified: trunk/blender/source/blender/editors/interface/interface_handlers.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_handlers.c	2013-03-13 14:12:17 UTC (rev 55235)
+++ trunk/blender/source/blender/editors/interface/interface_handlers.c	2013-03-13 14:19:53 UTC (rev 55236)
@@ -6302,7 +6302,7 @@
 static int ui_handle_button_event(bContext *C, const wmEvent *event, uiBut *but)
 {
 	uiHandleButtonData *data = but->active;
-	const uiButtonActivateType state_orig = data->state;
+	const uiHandleButtonState state_orig = data->state;
 	uiBlock *block;
 	ARegion *ar;
 	int retval;
@@ -6474,9 +6474,9 @@
 			 * This is needed to make sure if a button was active,
 			 * it stays active while the mouse is over it.
 			 * This avoids adding mousemoves, see: [#33466] */
-			if (ELEM(state_orig, BUTTON_ACTIVATE, BUTTON_ACTIVATE_OVER)) {
+			if (ELEM(state_orig, BUTTON_STATE_INIT, BUTTON_STATE_HIGHLIGHT)) {
 				if (ui_but_find_mouse_over(ar, event->x, event->y) == but) {
-					button_activate_init(C, ar, but, state_orig);
+					button_activate_init(C, ar, but, BUTTON_ACTIVATE_OVER);
 				}
 			}
 		}




More information about the Bf-blender-cvs mailing list