diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-12-14 20:10:46 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-12-14 20:10:46 +0400 |
commit | bb26d80ad88236800607bed0b0a72a5d14f67bb9 (patch) | |
tree | eb4882c30fa0bfc6c9a652631717ac740f5d6182 /source/blender/editors/screen | |
parent | e5407ef8d9fc0973089b2ac69e418179b99bfa18 (diff) |
code cleanup and move alternate shell calculation method into its own function: BM_vert_calc_shell_factor_ex
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index d819176e542..6e65d7fa59a 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -140,9 +140,11 @@ static int screen_active_editable(bContext *C) /* when mouse is over area-edge */ int ED_operator_screen_mainwinactive(bContext *C) { + bScreen *screen; if (CTX_wm_window(C) == NULL) return 0; - if (CTX_wm_screen(C) == NULL) return 0; - if (CTX_wm_screen(C)->subwinactive != CTX_wm_screen(C)->mainwin) return 0; + screen = CTX_wm_screen(C); + if (screen == NULL) return 0; + if (screen->subwinactive != screen->mainwin) return 0; return 1; } @@ -3412,6 +3414,7 @@ static void SCREEN_OT_back_to_previous(struct wmOperatorType *ot) static int userpref_show_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event) { + wmWindow *win = CTX_wm_window(C); rcti rect; int sizex, sizey; @@ -3420,8 +3423,8 @@ static int userpref_show_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *ev /* some magic to calculate postition */ /* pixelsize: mouse coords are in U.pixelsize units :/ */ - rect.xmin = (event->x / U.pixelsize) + CTX_wm_window(C)->posx - sizex / 2; - rect.ymin = (event->y / U.pixelsize) + CTX_wm_window(C)->posy - sizey / 2; + rect.xmin = (event->x / U.pixelsize) + win->posx - sizex / 2; + rect.ymin = (event->y / U.pixelsize) + win->posy - sizey / 2; rect.xmax = rect.xmin + sizex; rect.ymax = rect.ymin + sizey; |