aboutsummaryrefslogtreecommitdiffstats
path: root/swaybar
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2018-03-29 23:35:49 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2018-03-29 23:35:49 -0400
commitd8104db8f1820bd3d4db8bf4f1ee51ae334ee6e7 (patch)
treee615507417495238ac6262e6ca3d65819d200425 /swaybar
parentUse render_all_frames from bar_setup (diff)
downloadsway-d8104db8f1820bd3d4db8bf4f1ee51ae334ee6e7.tar.gz
sway-d8104db8f1820bd3d4db8bf4f1ee51ae334ee6e7.tar.zst
sway-d8104db8f1820bd3d4db8bf4f1ee51ae334ee6e7.zip
Early return from render functions if necessary
Diffstat (limited to 'swaybar')
-rw-r--r--swaybar/render.c6
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,
30 1, config->pango_markup, "%s", status->text); 30 1, config->pango_markup, "%s", status->text);
31 uint32_t ideal_height = text_height + ws_vertical_padding * 2; 31 uint32_t ideal_height = text_height + ws_vertical_padding * 2;
32 if (height < ideal_height) { 32 if (height < ideal_height) {
33 height = ideal_height; 33 return ideal_height;
34 } 34 }
35 double text_y = height / 2.0 - text_height / 2.0; 35 double text_y = height / 2.0 - text_height / 2.0;
36 cairo_move_to(cairo, width - text_width - margin, (int)floor(text_y)); 36 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,
70 uint32_t ideal_height = text_height + ws_vertical_padding * 2 70 uint32_t ideal_height = text_height + ws_vertical_padding * 2
71 + border_width * 2; 71 + border_width * 2;
72 if (height < ideal_height) { 72 if (height < ideal_height) {
73 height = ideal_height; 73 return ideal_height;
74 } 74 }
75 uint32_t width = text_width + ws_horizontal_padding * 2 + border_width * 2; 75 uint32_t width = text_width + ws_horizontal_padding * 2 + border_width * 2;
76 76
@@ -133,7 +133,7 @@ static uint32_t render_workspace_button(cairo_t *cairo,
133 uint32_t ideal_height = ws_vertical_padding * 2 + text_height 133 uint32_t ideal_height = ws_vertical_padding * 2 + text_height
134 + border_width * 2; 134 + border_width * 2;
135 if (height < ideal_height) { 135 if (height < ideal_height) {
136 height = ideal_height; 136 return ideal_height;
137 } 137 }
138 uint32_t width = ws_horizontal_padding * 2 + text_width + border_width * 2; 138 uint32_t width = ws_horizontal_padding * 2 + text_width + border_width * 2;
139 139