diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-04-30 07:44:03 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-04-30 07:44:03 +0400 |
commit | def15f275df4817408ec0e606e3122692540a9ef (patch) | |
tree | d55cfca0b9e432168ac66c0c24fae83dfad63ab0 /source/blender/editors | |
parent | cba25a6d900de5a99459d424ffae0092b4110c72 (diff) |
fix [#35156] Edge slide gg shortcut brings up wrong settings.
switch operator types from transform, this would normally be problematic, but transform operators share callbacks so it can be supported.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/transform/transform_ops.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index 546d02533fb..4f46e969c3c 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -339,6 +339,7 @@ static int transform_modal(bContext *C, wmOperator *op, const wmEvent *event) int exit_code; TransInfo *t = op->customdata; + const enum TfmMode mode_prev = t->mode; #if 0 // stable 2D mouse coords map to different 3D coords while the 3D mouse is active @@ -362,6 +363,28 @@ static int transform_modal(bContext *C, wmOperator *op, const wmEvent *event) transformops_exit(C, op); exit_code &= ~OPERATOR_PASS_THROUGH; /* preventively remove passthrough */ } + else { + if (mode_prev != t->mode) { + /* WARNING: this is not normal to switch operator types + * normally it would not be supported but transform happens + * to share callbacks between differernt operators. */ + wmOperatorType *ot_new = NULL; + TransformModeItem *item = transform_modes; + while (item->idname) { + if (item->mode == t->mode) { + ot_new = WM_operatortype_find(item->idname, false); + break; + } + item++; + } + + BLI_assert(ot_new != NULL); + if (ot_new) { + WM_operator_type_set(op, ot_new); + } + /* end suspicious code */ + } + } return exit_code; } |