Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2020-06-15 10:46:27 +0300
committerJacques Lucke <jacques@blender.org>2020-06-15 10:46:27 +0300
commit1d6529873f9f5e17dac491621e5b28b199b4af2c (patch)
treecea2264f77c4f49540d0aca96d467679fe52371b /source
parentbf8b62e874877b4bbe32c19b84bdc937320176ea (diff)
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
Diffstat (limited to 'source')
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c4
1 files changed, 1 insertions, 3 deletions
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;