[Bf-blender-cvs] [1ccc417] master: Invert value calculation for percentages it makes more sense that way

Antony Riakiotakis noreply at git.blender.org
Thu May 14 14:24:09 CEST 2015


Commit: 1ccc417477f4b629557708ebdb456b374e8a33f2
Author: Antony Riakiotakis
Date:   Thu May 14 14:16:28 2015 +0200
Branches: master
https://developer.blender.org/rB1ccc417477f4b629557708ebdb456b374e8a33f2

Invert value calculation for percentages it makes more sense that way

===================================================================

M	source/blender/windowmanager/intern/wm_operators.c

===================================================================

diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index e8782a7..6820493 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -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:




More information about the Bf-blender-cvs mailing list