Code cleanup: style
This commit is contained in:
@@ -1900,7 +1900,7 @@ static void ui_get_but_string_unit(uiBut *but, char *str, int len_max, double va
|
||||
/* Sanity checks */
|
||||
precision = (int)but->a2;
|
||||
if (precision > UI_PRECISION_FLOAT_MAX) precision = UI_PRECISION_FLOAT_MAX;
|
||||
else if (precision == -1) precision = 2;
|
||||
else if (precision == -1) precision = 2;
|
||||
}
|
||||
else {
|
||||
precision = float_precision;
|
||||
@@ -3116,7 +3116,7 @@ static void ui_def_but_rna__menu(bContext *UNUSED(C), uiLayout *layout, void *bu
|
||||
column_end = totitems;
|
||||
|
||||
for (b = a + 1; b < totitems; b++) {
|
||||
item = &item_array[ b];
|
||||
item = &item_array[b];
|
||||
|
||||
/* new column on N rows or on separation label */
|
||||
if (((b - a) % rows == 0) || (!item->identifier[0] && item->name)) {
|
||||
|
||||
@@ -749,12 +749,12 @@ void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol),
|
||||
|
||||
static float polar_to_x(float center, float diam, float ampli, float angle)
|
||||
{
|
||||
return center + diam *ampli * cosf(angle);
|
||||
return center + diam * ampli * cosf(angle);
|
||||
}
|
||||
|
||||
static float polar_to_y(float center, float diam, float ampli, float angle)
|
||||
{
|
||||
return center + diam *ampli * sinf(angle);
|
||||
return center + diam * ampli * sinf(angle);
|
||||
}
|
||||
|
||||
static void vectorscope_draw_target(float centerx, float centery, float diam, const float colf[3])
|
||||
|
||||
@@ -7224,7 +7224,7 @@ static int ui_handle_button_event(bContext *C, const wmEvent *event, uiBut *but)
|
||||
}
|
||||
else {
|
||||
/* XXX issue is because WM_event_add_mousemove(C) is a bad hack and not reliable,
|
||||
*if that gets coded better this bypass can go away too.
|
||||
* if that gets coded better this bypass can go away too.
|
||||
*
|
||||
* This is needed to make sure if a button was active,
|
||||
* it stays active while the mouse is over it.
|
||||
|
||||
@@ -479,13 +479,13 @@ static void init_brush_icons(void)
|
||||
|
||||
#define INIT_BRUSH_ICON(icon_id, name) \
|
||||
{ \
|
||||
unsigned char *rect = (unsigned char *)datatoc_ ##name## _png; \
|
||||
int size = datatoc_ ##name## _png_size; \
|
||||
DrawInfo *di; \
|
||||
unsigned char *rect = (unsigned char *)datatoc_ ##name## _png; \
|
||||
int size = datatoc_ ##name## _png_size; \
|
||||
DrawInfo *di; \
|
||||
\
|
||||
di = def_internal_icon(NULL, icon_id, 0, 0, w, ICON_TYPE_BUFFER); \
|
||||
di->data.buffer.image->datatoc_rect = rect; \
|
||||
di->data.buffer.image->datatoc_size = size; \
|
||||
di = def_internal_icon(NULL, icon_id, 0, 0, w, ICON_TYPE_BUFFER); \
|
||||
di->data.buffer.image->datatoc_rect = rect; \
|
||||
di->data.buffer.image->datatoc_size = size; \
|
||||
}
|
||||
/* end INIT_BRUSH_ICON */
|
||||
|
||||
@@ -614,13 +614,13 @@ static void init_internal_icons(void)
|
||||
#endif
|
||||
if (b16buf == NULL)
|
||||
b16buf = IMB_ibImageFromMemory((unsigned char *)datatoc_blender_icons16_png,
|
||||
datatoc_blender_icons16_png_size, IB_rect, NULL, "<blender icons>");
|
||||
datatoc_blender_icons16_png_size, IB_rect, NULL, "<blender icons>");
|
||||
if (b16buf)
|
||||
IMB_premultiply_alpha(b16buf);
|
||||
|
||||
if (b32buf == NULL)
|
||||
b32buf = IMB_ibImageFromMemory((unsigned char *)datatoc_blender_icons32_png,
|
||||
datatoc_blender_icons32_png_size, IB_rect, NULL, "<blender icons>");
|
||||
datatoc_blender_icons32_png_size, IB_rect, NULL, "<blender icons>");
|
||||
if (b32buf)
|
||||
IMB_premultiply_alpha(b32buf);
|
||||
|
||||
|
||||
@@ -430,7 +430,7 @@ void uiStyleInit(void)
|
||||
if (blf_mono_font_render == -1)
|
||||
blf_mono_font_render = BLF_load_mem_unique("monospace", monofont_ttf, monofont_size);
|
||||
|
||||
BLF_size(blf_mono_font_render, 12 * U.pixelsize, 72 );
|
||||
BLF_size(blf_mono_font_render, 12 * U.pixelsize, 72);
|
||||
}
|
||||
|
||||
void uiStyleFontSet(uiFontStyle *fs)
|
||||
|
||||
@@ -1495,7 +1495,7 @@ static void colorband_update_cb(bContext *UNUSED(C), void *bt_v, void *coba_v)
|
||||
}
|
||||
|
||||
static void colorband_buttons_layout(uiLayout *layout, uiBlock *block, ColorBand *coba, const rctf *butr,
|
||||
RNAUpdateCb *cb, int expand)
|
||||
RNAUpdateCb *cb, int expand)
|
||||
{
|
||||
uiLayout *row, *split, *subsplit;
|
||||
uiBut *bt;
|
||||
@@ -2430,7 +2430,7 @@ void uiTemplateLayers(uiLayout *layout, PointerRNA *ptr, const char *propname,
|
||||
}
|
||||
|
||||
void uiTemplateGameStates(uiLayout *layout, PointerRNA *ptr, const char *propname,
|
||||
PointerRNA *used_ptr, const char *used_propname, int active_state)
|
||||
PointerRNA *used_ptr, const char *used_propname, int active_state)
|
||||
{
|
||||
uiLayout *uRow, *uCol;
|
||||
PropertyRNA *prop, *used_prop = NULL;
|
||||
|
||||
@@ -2308,7 +2308,7 @@ void ui_hsvcube_pos_from_vals(uiBut *but, const rcti *rect, float *hsv, float *x
|
||||
case UI_GRAD_V_ALT:
|
||||
x = 0.5f;
|
||||
/* exception only for value strip - use the range set in but->min/max */
|
||||
y = (hsv[2] - but->softmin ) / (but->softmax - but->softmin);
|
||||
y = (hsv[2] - but->softmin) / (but->softmax - but->softmin);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -950,7 +950,7 @@ void ui_theme_init_default(void)
|
||||
rgba_char_args_set(btheme->tact.keytype_jitter, 148, 229, 117, 255);
|
||||
rgba_char_args_set(btheme->tact.keytype_jitter_select, 97, 192, 66, 255);
|
||||
|
||||
rgba_char_args_set(btheme->tact.keyborder, 0, 0, 0, 255);
|
||||
rgba_char_args_set(btheme->tact.keyborder, 0, 0, 0, 255);
|
||||
rgba_char_args_set(btheme->tact.keyborder_select, 0, 0, 0, 255);
|
||||
|
||||
/* space nla */
|
||||
@@ -969,7 +969,7 @@ void ui_theme_init_default(void)
|
||||
rgba_char_args_set(btheme->tnla.nla_sound, 43, 61, 61, 255);
|
||||
rgba_char_args_set(btheme->tnla.nla_sound_sel, 31, 122, 122, 255);
|
||||
|
||||
rgba_char_args_set(btheme->tnla.keyborder, 0, 0, 0, 255);
|
||||
rgba_char_args_set(btheme->tnla.keyborder, 0, 0, 0, 255);
|
||||
rgba_char_args_set(btheme->tnla.keyborder_select, 0, 0, 0, 255);
|
||||
|
||||
/* space file */
|
||||
@@ -1091,7 +1091,7 @@ void ui_theme_init_default(void)
|
||||
|
||||
/* space node, re-uses syntax and console color storage */
|
||||
btheme->tnode = btheme->tv3d;
|
||||
rgba_char_args_set(btheme->tnode.edge_select, 255, 255, 255, 255); /* wire selected */
|
||||
rgba_char_args_set(btheme->tnode.edge_select, 255, 255, 255, 255); /* wire selected */
|
||||
rgba_char_args_set(btheme->tnode.syntaxl, 155, 155, 155, 160); /* TH_NODE, backdrop */
|
||||
rgba_char_args_set(btheme->tnode.syntaxn, 100, 100, 100, 255); /* in */
|
||||
rgba_char_args_set(btheme->tnode.nodeclass_output, 100, 100, 100, 255); /* output */
|
||||
@@ -2381,12 +2381,12 @@ void init_userdef_do_versions(void)
|
||||
rgba_char_args_set(btheme->tact.keytype_jitter_select, 97, 192, 66, 255);
|
||||
|
||||
/* key border */
|
||||
rgba_char_args_set(btheme->tact.keyborder, 0, 0, 0, 255);
|
||||
rgba_char_args_set(btheme->tact.keyborder, 0, 0, 0, 255);
|
||||
rgba_char_args_set(btheme->tact.keyborder_select, 0, 0, 0, 255);
|
||||
|
||||
/* NLA ............................ */
|
||||
/* key border */
|
||||
rgba_char_args_set(btheme->tnla.keyborder, 0, 0, 0, 255);
|
||||
rgba_char_args_set(btheme->tnla.keyborder, 0, 0, 0, 255);
|
||||
rgba_char_args_set(btheme->tnla.keyborder_select, 0, 0, 0, 255);
|
||||
|
||||
/* Graph Editor ................... */
|
||||
|
||||
Reference in New Issue
Block a user