fix for own commit r54482, PROP_DISTANCE was being checked for by radial control operator. now allow PROP_NONE and treat it as a distance.

This commit is contained in:
Campbell Barton
2013-02-12 10:33:04 +00:00
parent 261295180c
commit ddf1d987e5

View File

@@ -3261,6 +3261,7 @@ static void radial_control_set_initial_mouse(RadialControl *rc, wmEvent *event)
rc->initial_mouse[1] = event->y;
switch (rc->subtype) {
case PROP_NONE:
case PROP_DISTANCE:
d[0] = rc->initial_value;
break;
@@ -3360,6 +3361,7 @@ static void radial_control_paint_cursor(bContext *C, int x, int y, void *customd
float zoom[2], col[3] = {1, 1, 1};
switch (rc->subtype) {
case PROP_NONE:
case PROP_DISTANCE:
r1 = rc->current_value;
r2 = rc->initial_value;
@@ -3598,8 +3600,8 @@ static int radial_control_invoke(bContext *C, wmOperator *op, wmEvent *event)
/* get subtype of property */
rc->subtype = RNA_property_subtype(rc->prop);
if (!ELEM3(rc->subtype, PROP_DISTANCE, PROP_FACTOR, PROP_ANGLE)) {
BKE_report(op->reports, RPT_ERROR, "Property must be a distance, a factor, or an angle");
if (!ELEM4(rc->subtype, PROP_NONE, PROP_DISTANCE, PROP_FACTOR, PROP_ANGLE)) {
BKE_report(op->reports, RPT_ERROR, "Property must be a none, distance, a factor, or an angle");
MEM_freeN(rc);
return OPERATOR_CANCELLED;
}
@@ -3683,6 +3685,7 @@ static int radial_control_modal(bContext *C, wmOperator *op, wmEvent *event)
/* calculate new value and apply snapping */
switch (rc->subtype) {
case PROP_NONE:
case PROP_DISTANCE:
new_value = dist;
if (snap) new_value = ((int)new_value + 5) / 10 * 10;