diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-11-13 16:37:51 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-11-13 16:57:26 +0300 |
commit | c7b77222542ce2e4eda548c51aa33013dddc0480 (patch) | |
tree | 9e9b8c761fa651fd1b01d08f5b21f8433be72e87 /source | |
parent | e527544b766bb01fb95bff1d98fe5a246aaf7398 (diff) |
Fix T71434: Sculpt lags changing brush size
Add a check to wm.radial_control so undo steps are only added
to properties that have undo enabled (as is done with number buttons).
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 6bafbed9804..e6762ecf56b 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -2654,7 +2654,8 @@ static int radial_control_modal(bContext *C, wmOperator *op, const wmEvent *even { RadialControl *rc = op->customdata; float new_value, dist = 0.0f, zoom[2]; - float delta[2], ret = OPERATOR_RUNNING_MODAL; + float delta[2]; + int ret = OPERATOR_RUNNING_MODAL; bool snap; float angle_precision = 0.0f; const bool has_numInput = hasNumInput(&rc->num_input); @@ -2856,6 +2857,16 @@ static int radial_control_modal(bContext *C, wmOperator *op, const wmEvent *even ED_region_tag_redraw(CTX_wm_region(C)); radial_control_update_header(op, C); + if (ret & OPERATOR_FINISHED) { + wmWindowManager *wm = CTX_wm_manager(C); + if (wm->op_undo_depth == 0) { + ID *id = rc->ptr.owner_id; + if (ED_undo_is_legacy_compatible_for_property(C, id)) { + ED_undo_push(C, op->type->name); + } + } + } + if (ret != OPERATOR_RUNNING_MODAL) { radial_control_cancel(C, op); } @@ -2873,7 +2884,7 @@ static void WM_OT_radial_control(wmOperatorType *ot) ot->modal = radial_control_modal; ot->cancel = radial_control_cancel; - ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING; + ot->flag = OPTYPE_REGISTER | OPTYPE_BLOCKING; /* all paths relative to the context */ PropertyRNA *prop; |