forked from bartvdbraak/blender
Fix T45060: Brush size snaps back to default max
This commit is contained in:
parent
d7cd8ff891
commit
9090d64544
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user