aboutsummaryrefslogtreecommitdiff
path: root/swaybar/render.c
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2019-09-09 19:05:15 +0800
committerFurkan Sahin <furkan-dev@proton.me>2019-09-09 19:05:15 +0800
commite1e27563caeb6d09ccb73fbb91fa103fc2c056a4 (patch)
treeacf1535a0f05d77bf262c3ca87df2f82ffc4b3d5 /swaybar/render.c
parent127799c004aefeed155687f1e32ccd129a7f5e19 (diff)
swaybar: make status block text render in the same way as others
Other components like workspace button, status line (error or plain text) already render text at integer coords. This make status block also render text at integer coords.
Diffstat (limited to 'swaybar/render.c')
-rw-r--r--swaybar/render.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/swaybar/render.c b/swaybar/render.c
index 36df2d86..0d6bb354 100644
--- a/swaybar/render.c
+++ b/swaybar/render.c
@@ -263,7 +263,8 @@ static uint32_t render_status_block(cairo_t *cairo,
} else if (strncmp(block->align, "center", 6) == 0) {
offset = x_pos + (width - text_width) / 2;
}
- cairo_move_to(cairo, offset, height / 2.0 - text_height / 2.0);
+ double text_y = height / 2.0 - text_height / 2.0;
+ cairo_move_to(cairo, offset, (int)floor(text_y));
uint32_t color = block->color ? *block->color : config->colors.statusline;
color = block->urgent ? config->colors.urgent_workspace.text : color;
cairo_set_source_u32(cairo, color);
@@ -286,7 +287,8 @@ static uint32_t render_status_block(cairo_t *cairo,
}
if (config->sep_symbol) {
offset = x_pos + (sep_block_width - sep_width) / 2;
- cairo_move_to(cairo, offset, height / 2.0 - sep_height / 2.0);
+ double sep_y = height / 2.0 - sep_height / 2.0;
+ cairo_move_to(cairo, offset, (int)floor(sep_y));
pango_printf(cairo, config->font, output->scale, false,
"%s", config->sep_symbol);
} else {