Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-11-06 08:56:30 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-11-06 08:56:30 +0400
commit96cb05f02803c342ac89add0d393d1d0dc23d2af (patch)
tree72db549657b5bf3ed0f3a26d6802a4db2a344531 /source
parentfb6ded3f593d5084e488093fb8ac4d133a27a659 (diff)
add comments for uiBut a1 and a2 values.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/interface/interface_handlers.c8
-rw-r--r--source/blender/editors/interface/interface_intern.h20
2 files changed, 23 insertions, 5 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 6d262daab12..ecb161714ee 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -3306,7 +3306,7 @@ static int ui_numedit_but_HSVCUBE(uiBut *but, uiHandleButtonData *data, int mx,
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 @@ static int ui_numedit_but_HSVCUBE(uiBut *but, uiHandleButtonData *data, int mx,
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 @@ static void ui_ndofedit_but_HSVCUBE(uiBut *but, uiHandleButtonData *data, wmNDOF
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 @@ static void ui_ndofedit_but_HSVCUBE(uiBut *but, uiHandleButtonData *data, wmNDOF
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);
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h
index 16159e0f73a..540a9cc752b 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -176,7 +176,25 @@ struct uiBut {
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];