diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-01-03 08:25:50 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-01-03 08:28:40 +0300 |
commit | eb6ca6cf9f28d8b30996e1dfd7c2fc7e4fcbc768 (patch) | |
tree | 0e02d21c412ed58e81510135f7d6ede9e21a3589 /source/blender/editors/screen | |
parent | e26a527770c3c313c090a2856391463abc333ded (diff) |
Fix gizmos flickering when resizing regions
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 7c47f7439ab..f5ce026e6d6 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -929,6 +929,8 @@ static void actionzone_exit(wmOperator *op) MEM_freeN(op->customdata); } op->customdata = NULL; + + G.moving &= ~G_TRANSFORM_WM; } /* send EVT_ACTIONZONE event */ @@ -986,9 +988,11 @@ static int actionzone_invoke(bContext *C, wmOperator *op, const wmEvent *event) return OPERATOR_FINISHED; } else { + BLI_assert(ELEM(sad->az->type, AZONE_AREA, AZONE_REGION_SCROLL)); + /* add modal handler */ + G.moving |= G_TRANSFORM_WM; WM_event_add_modal_handler(C, op); - return OPERATOR_RUNNING_MODAL; } } @@ -1807,9 +1811,8 @@ static int area_move_invoke(bContext *C, wmOperator *op, const wmEvent *event) return OPERATOR_PASS_THROUGH; } - G.moving |= G_TRANSFORM_WM; - /* add temp handler */ + G.moving |= G_TRANSFORM_WM; WM_event_add_modal_handler(C, op); return OPERATOR_RUNNING_MODAL; @@ -2115,6 +2118,8 @@ static void area_split_exit(bContext *C, wmOperator *op) /* this makes sure aligned edges will result in aligned grabbing */ BKE_screen_remove_double_scrverts(CTX_wm_screen(C)); BKE_screen_remove_double_scredges(CTX_wm_screen(C)); + + G.moving &= ~G_TRANSFORM_WM; } static void area_split_preview_update_cursor(bContext *C, wmOperator *op) @@ -2247,6 +2252,7 @@ static int area_split_invoke(bContext *C, wmOperator *op, const wmEvent *event) area_move_set_limits(win, sc, dir, &sd->bigger, &sd->smaller, NULL); /* add temp handler for edge move or cancel */ + G.moving |= G_TRANSFORM_WM; WM_event_add_modal_handler(C, op); return OPERATOR_RUNNING_MODAL; @@ -2526,6 +2532,14 @@ static bool is_split_edge(const int alignment, const AZEdge edge) ((alignment == RGN_ALIGN_RIGHT) && (edge == AE_LEFT_TO_TOPRIGHT)); } +static void region_scale_exit(wmOperator *op) +{ + MEM_freeN(op->customdata); + op->customdata = NULL; + + G.moving &= ~G_TRANSFORM_WM; +} + static int region_scale_invoke(bContext *C, wmOperator *op, const wmEvent *event) { sActionzoneData *sad = event->customdata; @@ -2579,6 +2593,7 @@ static int region_scale_invoke(bContext *C, wmOperator *op, const wmEvent *event CLAMP(rmd->maxsize, 0, 1000); /* add temp handler */ + G.moving |= G_TRANSFORM_WM; WM_event_add_modal_handler(C, op); return OPERATOR_RUNNING_MODAL; @@ -2727,8 +2742,8 @@ static int region_scale_modal(bContext *C, wmOperator *op, const wmEvent *event) ED_area_tag_redraw(rmd->sa); WM_event_add_notifier(C, NC_SCREEN | NA_EDITED, NULL); } - MEM_freeN(op->customdata); - op->customdata = NULL; + + region_scale_exit(op); return OPERATOR_FINISHED; } @@ -2743,8 +2758,7 @@ static int region_scale_modal(bContext *C, wmOperator *op, const wmEvent *event) static void region_scale_cancel(bContext *UNUSED(C), wmOperator *op) { - MEM_freeN(op->customdata); - op->customdata = NULL; + region_scale_exit(op); } static void SCREEN_OT_region_scale(wmOperatorType *ot) |