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
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2015-06-15 15:26:19 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-06-18 18:24:16 +0300
commit84e4eed317c6bb3df2186aea46afee158ed81d90 (patch)
treed11b0bc38ae77a8710dc195f3ed19c1372d23b58
parent12de321a01144992a9c6768a464233e1a95d2ef0 (diff)
Fix T45060: Brush size snaps back to default max
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 28cb01aa4a3..c69dc9de05b 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -4256,8 +4256,7 @@ static int radial_control_invoke(bContext *C, wmOperator *op, const wmEvent *eve
{
wmWindowManager *wm;
RadialControl *rc;
- int min_value_int, max_value_int, step_int;
- float step_float, precision;
+
if (!(op->customdata = rc = MEM_callocN(sizeof(RadialControl), "RadialControl")))
return OPERATOR_CANCELLED;
@@ -4270,17 +4269,29 @@ static int radial_control_invoke(bContext *C, wmOperator *op, const wmEvent *eve
/* get type, initial, min, and max values of the property */
switch ((rc->type = RNA_property_type(rc->prop))) {
case PROP_INT:
- rc->initial_value = RNA_property_int_get(&rc->ptr, rc->prop);
- RNA_property_int_ui_range(&rc->ptr, rc->prop, &min_value_int,
- &max_value_int, &step_int);
- rc->min_value = min_value_int;
- rc->max_value = max_value_int;
+ {
+ int value, min, max, step;
+
+ value = RNA_property_int_get(&rc->ptr, rc->prop);
+ RNA_property_int_ui_range(&rc->ptr, rc->prop, &min, &max, &step);
+
+ rc->initial_value = value;
+ rc->min_value = min_ii(value, min);
+ rc->max_value = max_ii(value, max);
break;
+ }
case PROP_FLOAT:
- rc->initial_value = RNA_property_float_get(&rc->ptr, rc->prop);
- RNA_property_float_ui_range(&rc->ptr, rc->prop, &rc->min_value,
- &rc->max_value, &step_float, &precision);
+ {
+ float value, min, max, step, precision;
+
+ value = RNA_property_float_get(&rc->ptr, rc->prop);
+ RNA_property_float_ui_range(&rc->ptr, rc->prop, &min, &min, &step, &precision);
+
+ rc->initial_value = value;
+ rc->min_value = min_ff(value, min);
+ rc->max_value = max_ff(value, max);
break;
+ }
default:
BKE_report(op->reports, RPT_ERROR, "Property must be an integer or a float");
MEM_freeN(rc);