Commit: 119cda0a0d258b104b3b1ab0bbd9b26d83ad0a67
Author: Julian Eisel
Date:   Fri Aug 14 22:19:14 2015 +0200
Branches: master
https://developer.blender.org/rB119cda0a0d258b104b3b1ab0bbd9b26d83ad0a67

Cleanup: Avoid calling function twice

Own stupidness from rB17422124eca332

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

M       source/blender/editors/interface/interface_handlers.c

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

diff --git a/source/blender/editors/interface/interface_handlers.c 
b/source/blender/editors/interface/interface_handlers.c
index 0adbd05..4adc866 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -9703,14 +9703,15 @@ static int ui_handler_region_menu(bContext *C, const 
wmEvent *event, void *UNUSE
                uiBut *but_other;
                uiHandleButtonData *data;
                bool is_inside_menu = false;
+               const int shadow_xy = UI_ThemeMenuShadowWidth();
 
                /* look for a popup menu containing the mouse */
                for (ar_temp = screen->regionbase.first; ar_temp; ar_temp = 
ar_temp->next) {
                        rcti rect = ar_temp->winrct;
 
                        /* resize region rect to ignore shadow */
-                       BLI_rcti_resize(&rect, 
(BLI_rcti_size_x(&ar_temp->winrct) - UI_ThemeMenuShadowWidth() * 2),
-                                       (BLI_rcti_size_y(&ar_temp->winrct) - 
UI_ThemeMenuShadowWidth() * 2));
+                       BLI_rcti_resize(&rect, 
BLI_rcti_size_x(&ar_temp->winrct) - shadow_xy * 2,
+                                       BLI_rcti_size_y(&ar_temp->winrct) - 
shadow_xy * 2);
                        if (BLI_rcti_isect_pt_v(&rect, &event->x)) {
                                BLI_assert(ar_temp->type->regionid == 
RGN_TYPE_TEMPORARY);

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to