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:
Diffstat (limited to 'source/blender/editors/interface/interface_widgets.c')
-rw-r--r--source/blender/editors/interface/interface_widgets.c42
1 files changed, 25 insertions, 17 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index b81825eba6e..dbd65ade307 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -674,13 +674,16 @@ static void round_box__edges(uiWidgetBase *wt, int roundboxalign, const rcti *re
float facxi = (maxxi != minxi) ? 1.0f / (maxxi - minxi) : 0.0f; /* for uv, can divide by zero */
float facyi = (maxyi != minyi) ? 1.0f / (maxyi - minyi) : 0.0f;
int a, tot = 0, minsize;
- const int hnum = ((roundboxalign & (UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT)) == (UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT) ||
- (roundboxalign & (UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT)) == (UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT)) ? 1 : 2;
- const int vnum = ((roundboxalign & (UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT)) == (UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT) ||
- (roundboxalign & (UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT)) == (UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT)) ? 1 : 2;
+ const int hnum = (
+ (roundboxalign & (UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT)) == (UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT) ||
+ (roundboxalign & (UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT)) == (UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT)) ? 1 : 2;
+ const int vnum = (
+ (roundboxalign & (UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT)) == (UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT) ||
+ (roundboxalign & (UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT)) == (UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT)) ? 1 : 2;
- minsize = min_ii(BLI_rcti_size_x(rect) * hnum,
- BLI_rcti_size_y(rect) * vnum);
+ minsize = min_ii(
+ BLI_rcti_size_x(rect) * hnum,
+ BLI_rcti_size_y(rect) * vnum);
if (2.0f * rad > minsize)
rad = 0.5f * minsize;
@@ -1662,8 +1665,9 @@ static void ui_text_clip_right_label(uiFontStyle *fstyle, uiBut *but, const rcti
/* once the label's gone, chop off the least significant digits */
if (but->strwidth > okwidth) {
float strwidth;
- drawstr_len = BLF_width_to_strlen(fstyle->uifont_id, but->drawstr + but->ofs,
- drawstr_len - but->ofs, okwidth, &strwidth) + but->ofs;
+ drawstr_len = BLF_width_to_strlen(
+ fstyle->uifont_id, but->drawstr + but->ofs,
+ drawstr_len - but->ofs, okwidth, &strwidth) + but->ofs;
but->strwidth = strwidth;
but->drawstr[drawstr_len] = 0;
}
@@ -1690,8 +1694,9 @@ static void widget_draw_text_ime_underline(
ofs_x = 0;
}
- width = BLF_width(fstyle->uifont_id, drawstr + but->ofs,
- ime_data->composite_len + but->pos - but->ofs);
+ width = BLF_width(
+ fstyle->uifont_id, drawstr + but->ofs,
+ ime_data->composite_len + but->pos - but->ofs);
rgba_uchar_to_float(fcol, wcol->text);
UI_draw_text_underline(rect->xmin + ofs_x, rect->ymin + 6 * U.pixelsize, min_ii(width, rect_x - 2) - ofs_x, 1, fcol);
@@ -1708,8 +1713,9 @@ static void widget_draw_text_ime_underline(
ofs_x = 0;
}
- width = BLF_width(fstyle->uifont_id, drawstr + but->ofs,
- sel_end + sel_start - but->ofs);
+ width = BLF_width(
+ fstyle->uifont_id, drawstr + but->ofs,
+ sel_end + sel_start - but->ofs);
UI_draw_text_underline(rect->xmin + ofs_x, rect->ymin + 6 * U.pixelsize, min_ii(width, rect_x - 2) - ofs_x, 2, fcol);
}
@@ -1762,9 +1768,10 @@ static void widget_draw_text(uiFontStyle *fstyle, uiWidgetColors *wcol, uiBut *b
if (ime_data && ime_data->composite_len) {
/* insert composite string into cursor pos */
- BLI_snprintf((char *)drawstr, UI_MAX_DRAW_STR, "%s%s%s",
- but->editstr, ime_data->str_composite,
- but->editstr + but->pos);
+ BLI_snprintf(
+ (char *)drawstr, UI_MAX_DRAW_STR, "%s%s%s",
+ but->editstr, ime_data->str_composite,
+ but->editstr + but->pos);
}
else
#endif
@@ -2443,8 +2450,9 @@ static void ui_hsv_cursor(float x, float y)
immUnbindProgram();
}
-void ui_hsvcircle_vals_from_pos(float *val_rad, float *val_dist, const rcti *rect,
- const float mx, const float my)
+void ui_hsvcircle_vals_from_pos(
+ float *val_rad, float *val_dist, const rcti *rect,
+ const float mx, const float my)
{
/* duplication of code... well, simple is better now */
const float centx = BLI_rcti_cent_x_fl(rect);