diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-03-29 23:35:49 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2018-03-29 23:35:49 -0400 |
commit | d8104db8f1820bd3d4db8bf4f1ee51ae334ee6e7 (patch) | |
tree | e615507417495238ac6262e6ca3d65819d200425 | |
parent | 095ac319214d6e51df223950292bfca5ddaf591a (diff) |
Early return from render functions if necessary
-rw-r--r-- | swaybar/render.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/swaybar/render.c b/swaybar/render.c index a5834f4b..3d9ef66b 100644 --- a/swaybar/render.c +++ b/swaybar/render.c @@ -30,7 +30,7 @@ static uint32_t render_status_line_text(cairo_t *cairo, 1, config->pango_markup, "%s", status->text); uint32_t ideal_height = text_height + ws_vertical_padding * 2; if (height < ideal_height) { - height = ideal_height; + return ideal_height; } double text_y = height / 2.0 - text_height / 2.0; cairo_move_to(cairo, width - text_width - margin, (int)floor(text_y)); @@ -70,7 +70,7 @@ static uint32_t render_binding_mode_indicator(cairo_t *cairo, uint32_t ideal_height = text_height + ws_vertical_padding * 2 + border_width * 2; if (height < ideal_height) { - height = ideal_height; + return ideal_height; } uint32_t width = text_width + ws_horizontal_padding * 2 + border_width * 2; @@ -133,7 +133,7 @@ static uint32_t render_workspace_button(cairo_t *cairo, uint32_t ideal_height = ws_vertical_padding * 2 + text_height + border_width * 2; if (height < ideal_height) { - height = ideal_height; + return ideal_height; } uint32_t width = ws_horizontal_padding * 2 + text_width + border_width * 2; |