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
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-03-25 02:15:20 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-03-25 03:16:46 +0300
commite86e0aad55675a5c4473d0538146dbccda7613e8 (patch)
treef20540ba9e01cc8d7e13090df8fbf9691cb8b01b /source/blender/editors/interface/interface_region_color_picker.c
parent72ede30d0f970fe7d6774ce0851e3aacc82e23d8 (diff)
Cleanup: use braces for interface code
Diffstat (limited to 'source/blender/editors/interface/interface_region_color_picker.c')
-rw-r--r--source/blender/editors/interface/interface_region_color_picker.c33
1 files changed, 23 insertions, 10 deletions
diff --git a/source/blender/editors/interface/interface_region_color_picker.c b/source/blender/editors/interface/interface_region_color_picker.c
index f96210b46d4..52136cee9ea 100644
--- a/source/blender/editors/interface/interface_region_color_picker.c
+++ b/source/blender/editors/interface/interface_region_color_picker.c
@@ -178,8 +178,9 @@ static void ui_update_color_picker_buts_rgb(
/* this updates button strings,
* is hackish... but button pointers are on stack of caller function */
for (bt = block->buttons.first; bt; bt = bt->next) {
- if (bt->custom_data != cpicker)
+ if (bt->custom_data != cpicker) {
continue;
+ }
if (bt->rnaprop) {
ui_but_v3_set(bt, rgb);
@@ -201,9 +202,15 @@ static void ui_update_color_picker_buts_rgb(
IMB_colormanagement_scene_linear_to_srgb_v3(rgb_hex);
}
- if (rgb_hex[0] > 1.0f) rgb_hex[0] = modf(rgb_hex[0], &intpart);
- if (rgb_hex[1] > 1.0f) rgb_hex[1] = modf(rgb_hex[1], &intpart);
- if (rgb_hex[2] > 1.0f) rgb_hex[2] = modf(rgb_hex[2], &intpart);
+ if (rgb_hex[0] > 1.0f) {
+ rgb_hex[0] = modf(rgb_hex[0], &intpart);
+ }
+ if (rgb_hex[1] > 1.0f) {
+ rgb_hex[1] = modf(rgb_hex[1], &intpart);
+ }
+ if (rgb_hex[2] > 1.0f) {
+ rgb_hex[2] = modf(rgb_hex[2], &intpart);
+ }
rgb_float_to_uchar(rgb_hex_uchar, rgb_hex);
BLI_snprintf(col, sizeof(col), "%02X%02X%02X", UNPACK3_EX((uint), rgb_hex_uchar, ));
@@ -252,8 +259,9 @@ static void ui_colorpicker_rna_cb(bContext *UNUSED(C), void *bt1, void *UNUSED(a
but, but->block, but->custom_data, rgb);
}
- if (popup)
+ if (popup) {
popup->menuretval = UI_RETURN_UPDATE;
+ }
}
static void ui_color_wheel_rna_cb(bContext *UNUSED(C), void *bt1, void *UNUSED(arg))
@@ -271,8 +279,9 @@ static void ui_color_wheel_rna_cb(bContext *UNUSED(C), void *bt1, void *UNUSED(a
ui_update_color_picker_buts_rgb(but, but->block, cpicker, rgb);
- if (popup)
+ if (popup) {
popup->menuretval = UI_RETURN_UPDATE;
+ }
}
static void ui_colorpicker_hex_rna_cb(bContext *UNUSED(C), void *bt1, void *hexcl)
@@ -292,8 +301,9 @@ static void ui_colorpicker_hex_rna_cb(bContext *UNUSED(C), void *bt1, void *hexc
ui_update_color_picker_buts_rgb(but, but->block, cpicker, rgb);
- if (popup)
+ if (popup) {
popup->menuretval = UI_RETURN_UPDATE;
+ }
}
static void ui_popup_close_cb(bContext *UNUSED(C), void *bt1, void *UNUSED(arg))
@@ -589,10 +599,12 @@ static int ui_colorpicker_small_wheel_cb(const bContext *UNUSED(C), uiBlock *blo
{
float add = 0.0f;
- if (event->type == WHEELUPMOUSE)
+ if (event->type == WHEELUPMOUSE) {
add = 0.05f;
- else if (event->type == WHEELDOWNMOUSE)
+ }
+ else if (event->type == WHEELDOWNMOUSE) {
add = -0.05f;
+ }
if (add != 0.0f) {
uiBut *but;
@@ -615,8 +627,9 @@ static int ui_colorpicker_small_wheel_cb(const bContext *UNUSED(C), uiBlock *blo
ui_but_v3_set(but, rgb);
ui_update_color_picker_buts_rgb(but, block, cpicker, rgb);
- if (popup)
+ if (popup) {
popup->menuretval = UI_RETURN_UPDATE;
+ }
return 1;
}