[Bf-blender-cvs] [1d6529873f9] master: Fix T77735: Numinput of radial control operator behaved incorrectly
Jacques Lucke
noreply at git.blender.org
Mon Jun 15 09:49:39 CEST 2020
Commit: 1d6529873f9f5e17dac491621e5b28b199b4af2c
Author: Jacques Lucke
Date: Mon Jun 15 09:46:27 2020 +0200
Branches: master
https://developer.blender.org/rB1d6529873f9f5e17dac491621e5b28b199b4af2c
Fix T77735: Numinput of radial control operator behaved incorrectly
This fixes the behavior of `ctrl+F` and `shift+F` to control the angle
and strength of a brush when the unit scale is not one.
Reviewers: pablodp606
Differential Revision: https://developer.blender.org/D7992
===================================================================
M source/blender/windowmanager/intern/wm_operators.c
===================================================================
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index f99f47bc3ad..6fb1e3e251d 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -2730,7 +2730,7 @@ static int radial_control_invoke(bContext *C, wmOperator *op, const wmEvent *eve
rc->num_input.idx_max = 0;
rc->num_input.val_flag[0] |= NUM_NO_NEGATIVE;
rc->num_input.unit_sys = USER_UNIT_NONE;
- rc->num_input.unit_type[0] = B_UNIT_LENGTH;
+ rc->num_input.unit_type[0] = RNA_SUBTYPE_UNIT_VALUE(RNA_property_unit(rc->prop));
/* get subtype of property */
rc->subtype = RNA_property_subtype(rc->prop);
@@ -2829,7 +2829,6 @@ static int radial_control_modal(bContext *C, wmOperator *op, const wmEvent *even
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;
@@ -2994,7 +2993,6 @@ static int radial_control_modal(bContext *C, wmOperator *op, const wmEvent *even
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;
More information about the Bf-blender-cvs
mailing list