Fix swaybar block background fill logic

When a block is padded to uphold `min_width`, the background colour is now applied to the whole block rather than just the original width before padding. This brings the behaviour in-line with i3bar.
This commit is contained in:
Jason 2018-09-05 03:31:32 +09:00 committed by GitHub
parent 79a7a2c938
commit ea215b551d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -111,7 +111,7 @@ static void render_block(struct window *window, struct config *config, struct st
// render background
if (block->background != 0x0) {
cairo_set_source_u32(window->cairo, block->background);
cairo_rectangle(window->cairo, pos - 0.5, 1, block_width, (window->height * window->scale) - 2);
cairo_rectangle(window->cairo, pos - 0.5, 1, width, (window->height * window->scale) - 2);
cairo_fill(window->cairo);
}