Invert value calculation for percentages it makes more sense that way

This commit is contained in:
Antonis Ryakiotakis 2015-05-14 14:16:28 +02:00
parent 7aa74dfe5e
commit 1ccc417477
1 changed files with 3 additions and 3 deletions

View File

@ -3900,7 +3900,7 @@ static void radial_control_set_initial_mouse(RadialControl *rc, const wmEvent *e
d[0] = rc->initial_value * U.pixelsize;
break;
case PROP_PERCENTAGE:
d[0] = (100.0f - rc->initial_value) / 100.0f * WM_RADIAL_CONTROL_DISPLAY_WIDTH + WM_RADIAL_CONTROL_DISPLAY_MIN_SIZE;
d[0] = (rc->initial_value) / 100.0f * WM_RADIAL_CONTROL_DISPLAY_WIDTH + WM_RADIAL_CONTROL_DISPLAY_MIN_SIZE;
break;
case PROP_FACTOR:
d[0] = (1 - rc->initial_value) * WM_RADIAL_CONTROL_DISPLAY_WIDTH + WM_RADIAL_CONTROL_DISPLAY_MIN_SIZE;
@ -4014,7 +4014,7 @@ static void radial_control_paint_cursor(bContext *C, int x, int y, void *customd
alpha = 0.75;
break;
case PROP_PERCENTAGE:
r1 = (100.0f - rc->current_value) / 100.0f * WM_RADIAL_CONTROL_DISPLAY_WIDTH + WM_RADIAL_CONTROL_DISPLAY_MIN_SIZE;
r1 = rc->current_value / 100.0f * WM_RADIAL_CONTROL_DISPLAY_WIDTH + WM_RADIAL_CONTROL_DISPLAY_MIN_SIZE;
r2 = tex_radius = WM_RADIAL_CONTROL_DISPLAY_SIZE;
rmin = WM_RADIAL_CONTROL_DISPLAY_MIN_SIZE;
BLI_snprintf(str, WM_RADIAL_MAX_STR, "%3.1f%%", rc->current_value);
@ -4462,7 +4462,7 @@ static int radial_control_modal(bContext *C, wmOperator *op, const wmEvent *even
new_value /= U.pixelsize;
break;
case PROP_PERCENTAGE:
new_value = ((WM_RADIAL_CONTROL_DISPLAY_SIZE - dist) / WM_RADIAL_CONTROL_DISPLAY_WIDTH) * 100.0f;
new_value = ((dist - WM_RADIAL_CONTROL_DISPLAY_MIN_SIZE) / WM_RADIAL_CONTROL_DISPLAY_WIDTH) * 100.0f;
if (snap) new_value = ((int)(new_value + 2.5)) / 5 * 5;
break;
case PROP_FACTOR: