Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGermano Cavalcante <germano.costa@ig.com.br>2022-02-05 01:34:56 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2022-02-05 02:38:53 +0300
commitb1b1a74af15b4eaa0757ad88acfbcac73b9a64fe (patch)
tree0132cce785cc9305f8ea1dacf13fd453ede8f450 /source/blender/editors/space_view3d/view3d_navigate_zoom.c
parentec9f237a9ef01e5966228e0789eeecc419021f56 (diff)
Cleanup: set 'op->customdata' out of 'viewops_data_create'
Setting the `op->customdata` out of `viewops_data_create` makes the usage of the function clearer thus making the code easier to read.
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_navigate_zoom.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_navigate_zoom.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/editors/space_view3d/view3d_navigate_zoom.c b/source/blender/editors/space_view3d/view3d_navigate_zoom.c
index d4f3de64341..d7b1daa93c2 100644
--- a/source/blender/editors/space_view3d/view3d_navigate_zoom.c
+++ b/source/blender/editors/space_view3d/view3d_navigate_zoom.c
@@ -418,7 +418,8 @@ static int viewzoom_modal(bContext *C, wmOperator *op, const wmEvent *event)
}
if (ret & OPERATOR_FINISHED) {
- viewops_data_free(C, op);
+ viewops_data_free(C, op->customdata);
+ op->customdata = NULL;
}
return ret;
@@ -499,7 +500,8 @@ static int viewzoom_exec(bContext *C, wmOperator *op)
ED_region_tag_redraw(region);
- viewops_data_free(C, op);
+ viewops_data_free(C, op->customdata);
+ op->customdata = NULL;
return OPERATOR_FINISHED;
}
@@ -511,13 +513,11 @@ static int viewzoom_invoke(bContext *C, wmOperator *op, const wmEvent *event)
const bool use_cursor_init = RNA_boolean_get(op->ptr, "use_cursor_init");
- /* makes op->customdata */
- viewops_data_create(C,
- op,
- event,
- (viewops_flag_from_prefs() & ~VIEWOPS_FLAG_ORBIT_SELECT) |
- (use_cursor_init ? VIEWOPS_FLAG_USE_MOUSE_INIT : 0));
- vod = op->customdata;
+ vod = op->customdata = viewops_data_create(
+ C,
+ event,
+ (viewops_flag_from_prefs() & ~VIEWOPS_FLAG_ORBIT_SELECT) |
+ (use_cursor_init ? VIEWOPS_FLAG_USE_MOUSE_INIT : 0));
ED_view3d_smooth_view_force_finish(C, vod->v3d, vod->region);