[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [51929] trunk/blender/source/blender/ editors/interface: add comments for uiBut a1 and a2 values.

Campbell Barton ideasman42 at gmail.com
Tue Nov 6 05:56:35 CET 2012


Revision: 51929
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=51929
Author:   campbellbarton
Date:     2012-11-06 04:56:30 +0000 (Tue, 06 Nov 2012)
Log Message:
-----------
add comments for uiBut a1 and a2 values.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/interface/interface_handlers.c
    trunk/blender/source/blender/editors/interface/interface_intern.h

Modified: trunk/blender/source/blender/editors/interface/interface_handlers.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_handlers.c	2012-11-06 04:17:46 UTC (rev 51928)
+++ trunk/blender/source/blender/editors/interface/interface_handlers.c	2012-11-06 04:56:30 UTC (rev 51929)
@@ -3306,7 +3306,7 @@
 
 	ui_get_but_vectorf(but, rgb);
 
-	if (color_profile && (int)but->a1)
+	if (color_profile && (int)but->a1 != UI_GRAD_SV)
 		ui_block_to_display_space_v3(but->block, rgb);
 
 	rgb_to_hsv_compat_v(rgb, hsv);
@@ -3352,7 +3352,7 @@
 
 	hsv_to_rgb_v(hsv, rgb);
 
-	if (color_profile && (int)but->a1)
+	if (color_profile && ((int)but->a1 != UI_GRAD_SV))
 		ui_block_to_scene_linear_v3(but->block, rgb);
 
 	copy_v3_v3(data->vec, rgb);
@@ -3378,7 +3378,7 @@
 
 	ui_get_but_vectorf(but, rgb);
 
-	if (color_profile && (int)but->a1)
+	if (color_profile && (int)but->a1 != UI_GRAD_SV)
 		ui_block_to_display_space_v3(but->block, rgb);
 
 	rgb_to_hsv_compat_v(rgb, hsv);
@@ -3418,7 +3418,7 @@
 
 	hsv_to_rgb_v(hsv, rgb);
 
-	if (color_profile && (int)but->a1)
+	if (color_profile && (int)but->a1 != UI_GRAD_SV)
 		ui_block_to_scene_linear_v3(but->block, rgb);
 
 	copy_v3_v3(data->vec, rgb);

Modified: trunk/blender/source/blender/editors/interface/interface_intern.h
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_intern.h	2012-11-06 04:17:46 UTC (rev 51928)
+++ trunk/blender/source/blender/editors/interface/interface_intern.h	2012-11-06 04:56:30 UTC (rev 51929)
@@ -176,7 +176,25 @@
 
 	char *poin;
 	float hardmin, hardmax, softmin, softmax;
-	float a1, a2;
+
+	/* both these values use depends on the button type
+	 * (polymorphic struct or union would be nicer for this stuff) */
+
+	/* (type == COLOR),      Use UI_GRAD_* values.
+	 * (type == NUM),        Use to store RNA 'step' value, for dragging and click-step.
+	 * (type == LABEL),      Use (a1 == 1.0f) to use a2 as a blending factor (wow, this is imaginative!).
+	 * (type == SCROLL)      Use as scroll size.
+	 * (type == SEARCH_MENU) Use as number or rows.
+	 */
+	float a1;
+
+	/* (type == HSVCIRCLE ), Use to store the luminosity.
+	 * (type == NUM),        Use to store RNA 'precision' value, for dragging and click-step.
+	 * (type == LABEL),      If (a1 == 1.0f) use a2 as a blending factor.
+	 * (type == SEARCH_MENU) Use as number or columns.
+	 */
+	float a2;
+
 	float aspect;
 	unsigned char col[4];
 




More information about the Bf-blender-cvs mailing list