diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index c49e8338e12..6bf11d4d4da 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -768,6 +768,7 @@ void applyMouseInput(struct TransInfo *t, const int mval[2], float output[3]); void transform_input_update(TransInfo *t, const float fac); +void transform_input_virtual_mval_reset(TransInfo *t); void setCustomPoints(TransInfo *t, MouseInput *mi, const int start[2], const int end[2]); void setCustomPointsFromDirection(TransInfo *t, MouseInput *mi, const float dir[2]); diff --git a/source/blender/editors/transform/transform_input.c b/source/blender/editors/transform/transform_input.c index bba57ff9602..088240055a7 100644 --- a/source/blender/editors/transform/transform_input.c +++ b/source/blender/editors/transform/transform_input.c @@ -494,4 +494,18 @@ void transform_input_update(TransInfo *t, const float fac) } } +void transform_input_virtual_mval_reset(TransInfo *t) +{ + MouseInput *mi = &t->mouse; + if (ELEM(mi->apply, InputAngle, InputAngleSpring)) { + struct InputAngle_Data *data = mi->data; + data->angle = 0.0; + data->mval_prev[0] = mi->imval[0]; + data->mval_prev[1] = mi->imval[1]; + } + else { + memset(&mi->virtual_mval, 0, sizeof(mi->virtual_mval)); + } +} + /** \} */ diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index b501649a614..881dbabb385 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -428,9 +428,10 @@ static int transform_modal(bContext *C, wmOperator *op, const wmEvent *event) } if (t->modifiers & MOD_PRECISION) { - /* Remove Precision modifier, it may have be unintentionally enabled. */ + /* WORKAROUND: Remove precision modification, it may have be unintentionally enabled. */ t->modifiers &= ~MOD_PRECISION; - t->mouse.precision = 0; + t->mouse.precision = false; + transform_input_virtual_mval_reset(t); } /* Make sure `t->mval` is up to date before calling #transformViewUpdate. */