diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-11-21 15:06:06 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-11-21 15:15:02 +0300 |
commit | 7c18fcbe03271f15ed4f6f4af14c60e84f8bb9cc (patch) | |
tree | c7653aa120e435ca13b053e1e097f577db1b44cf /source | |
parent | 355905cb0278c368059fdecef8735b731d97b97c (diff) |
Cleanup: clang-format
Also remove unused vars.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/BKE_curveprofile.h | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/curveprofile.c | 6 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_text/text_draw.c | 18 | ||||
-rw-r--r-- | source/blender/editors/space_text/text_intern.h | 3 | ||||
-rw-r--r-- | source/blender/editors/space_text/text_ops.c | 3 |
6 files changed, 18 insertions, 22 deletions
diff --git a/source/blender/blenkernel/BKE_curveprofile.h b/source/blender/blenkernel/BKE_curveprofile.h index 1f6659d785a..4f5cb268c09 100644 --- a/source/blender/blenkernel/BKE_curveprofile.h +++ b/source/blender/blenkernel/BKE_curveprofile.h @@ -65,8 +65,8 @@ void BKE_curveprofile_update(struct CurveProfile *profile, const bool rem_double float BKE_curveprofile_total_length(const struct CurveProfile *profile); void BKE_curveprofile_create_samples_even_spacing(struct CurveProfile *profile, - int segments_len, - struct CurveProfilePoint *r_samples); + int segments_len, + struct CurveProfilePoint *r_samples); /* Length portion is the fraction of the total path length where we want the location */ void BKE_curveprofile_evaluate_length_portion(const struct CurveProfile *profile, diff --git a/source/blender/blenkernel/intern/curveprofile.c b/source/blender/blenkernel/intern/curveprofile.c index 6689eca132d..df877e78379 100644 --- a/source/blender/blenkernel/intern/curveprofile.c +++ b/source/blender/blenkernel/intern/curveprofile.c @@ -224,9 +224,9 @@ void BKE_curveprofile_selected_handle_set(CurveProfile *profile, int type_1, int case HD_VECT: profile->path[i].h2 = HD_VECT; break; - default: - profile->path[i].h1 = HD_AUTO; - break; + default: + profile->path[i].h1 = HD_AUTO; + break; } } } diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 673e4c1a8da..4a354dabd30 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -6935,8 +6935,10 @@ static bool ui_numedit_but_CURVEPROFILE(uiBlock *block, * but in practice this isnt really an issue */ if (ui_but_is_cursor_warp(but)) { /* OK but can go outside bounds */ - data->ungrab_mval[0] = but->rect.xmin + ((point_last->x - profile->view_rect.xmin) * zoomx); - data->ungrab_mval[1] = but->rect.ymin + ((point_last->y - profile->view_rect.ymin) * zoomy); + data->ungrab_mval[0] = but->rect.xmin + + ((point_last->x - profile->view_rect.xmin) * zoomx); + data->ungrab_mval[1] = but->rect.ymin + + ((point_last->y - profile->view_rect.ymin) * zoomy); BLI_rctf_clamp_pt_v(&but->rect, data->ungrab_mval); } #endif diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index b2366cbe182..278d5dad808 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -1314,7 +1314,7 @@ static void draw_text_decoration(SpaceText *st, ARegion *ar) } if (st->line_hlight) { - int x1, x2, y1, y2; + int y1, y2; if (st->wordwrap) { int visible_lines = text_get_visible_lines(st, ar, text->sell->line); @@ -1337,8 +1337,7 @@ static void draw_text_decoration(SpaceText *st, ARegion *ar) GPU_blend_set_func_separate( GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); GPU_blend(true); - immRecti( - pos, 0, y1, ar->winx, y2); + immRecti(pos, 0, y1, ar->winx, y2); GPU_blend(false); } } @@ -1360,11 +1359,8 @@ static void draw_text_decoration(SpaceText *st, ARegion *ar) w *= st->tabnumber - (vselc + st->left) % st->tabnumber; } - immRecti(pos, - x, - y - lheight - U.pixelsize, - x + w + U.pixelsize, - y - lheight - (3 * U.pixelsize)); + immRecti( + pos, x, y - lheight - U.pixelsize, x + w + U.pixelsize, y - lheight - (3 * U.pixelsize)); } else { immRecti(pos, x - U.pixelsize, y, x + U.pixelsize, y - lheight); @@ -1512,8 +1508,7 @@ static void draw_brackets(const SpaceText *st, const TextDrawContext *tdc, ARegi viewl = txt_get_span(text->lines.first, startl) - st->top + offl; text_font_draw_character(tdc, x + viewc * st->cwidth, y - viewl * TXT_LINE_HEIGHT(st), ch); - text_font_draw_character( - tdc, x + viewc * st->cwidth + 1, y - viewl * TXT_LINE_HEIGHT(st), ch); + text_font_draw_character(tdc, x + viewc * st->cwidth + 1, y - viewl * TXT_LINE_HEIGHT(st), ch); } /* draw closing bracket */ @@ -1525,8 +1520,7 @@ static void draw_brackets(const SpaceText *st, const TextDrawContext *tdc, ARegi viewl = txt_get_span(text->lines.first, endl) - st->top + offl; text_font_draw_character(tdc, x + viewc * st->cwidth, y - viewl * TXT_LINE_HEIGHT(st), ch); - text_font_draw_character( - tdc, x + viewc * st->cwidth + 1, y - viewl * TXT_LINE_HEIGHT(st), ch); + text_font_draw_character(tdc, x + viewc * st->cwidth + 1, y - viewl * TXT_LINE_HEIGHT(st), ch); } } diff --git a/source/blender/editors/space_text/text_intern.h b/source/blender/editors/space_text/text_intern.h index fb81f9a9553..ca37e9dcd3f 100644 --- a/source/blender/editors/space_text/text_intern.h +++ b/source/blender/editors/space_text/text_intern.h @@ -52,7 +52,8 @@ void text_update_cursor_moved(struct bContext *C); /* Padding on left of body text in character units. */ #define TXT_BODY_LPAD 1.0f /* Left position of body text. */ -#define TXT_BODY_LEFT(st) (st->showlinenrs ? TXT_NUMCOL_WIDTH(st) : 0) + (TXT_BODY_LPAD * st->cwidth) +#define TXT_BODY_LEFT(st) \ + (st->showlinenrs ? TXT_NUMCOL_WIDTH(st) : 0) + (TXT_BODY_LPAD * st->cwidth) #define TXT_SCROLL_WIDTH U.widget_unit #define TXT_SCROLL_SPACE ((int)(0.1f * U.widget_unit)) diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 864c7912074..a4608123f19 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -3256,8 +3256,7 @@ static int text_line_number_invoke(bContext *C, wmOperator *UNUSED(op), const wm } if (!(mval[0] > 2 && mval[0] < (TXT_NUMCOL_WIDTH(st) + (TXT_BODY_LPAD * st->cwidth)) && - mval[1] > 2 && - mval[1] < ar->winy - 2)) { + mval[1] > 2 && mval[1] < ar->winy - 2)) { return OPERATOR_PASS_THROUGH; } |