diff options
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 15ae9eba10f..5b944a7b1ec 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -4319,9 +4319,17 @@ static int radial_control_modal(bContext *C, wmOperator *op, const wmEvent *even if (event->val == KM_PRESS && has_numInput && handleNumInput(C, &rc->num_input, event)) { handled = true; applyNumInput(&rc->num_input, &numValue); + + if (rc->subtype == PROP_ANGLE) { + numValue = DEG2RADF(numValue); + numValue = fmod(numValue, 2.0f * (float)M_PI); + if (numValue < 0.0f) + numValue += 2.0f * (float)M_PI; + } + CLAMP(numValue, rc->min_value, rc->max_value); new_value = numValue; - + radial_control_set_value(rc, new_value); rc->current_value = new_value; radial_control_update_header(op, C); @@ -4459,10 +4467,19 @@ static int radial_control_modal(bContext *C, wmOperator *op, const wmEvent *even /* Modal numinput inactive, try to handle numeric inputs last... */ if (!handled && event->val == KM_PRESS && handleNumInput(C, &rc->num_input, event)) { applyNumInput(&rc->num_input, &numValue); + + if (rc->subtype == PROP_ANGLE) { + numValue = DEG2RADF(numValue); + numValue = fmod(numValue, 2.0f * (float)M_PI); + if (numValue < 0.0f) + numValue += 2.0f * (float)M_PI; + } + CLAMP(numValue, rc->min_value, rc->max_value); new_value = numValue; - + radial_control_set_value(rc, new_value); + rc->current_value = new_value; radial_control_update_header(op, C); return OPERATOR_RUNNING_MODAL; |