diff options
| author | Max Verevkin <maxxverrr@gmail.com> | 2022-04-03 16:48:18 +0300 |
|---|---|---|
| committer | Max Verevkin <maxxverrr@gmail.com> | 2022-04-03 16:48:18 +0300 |
| commit | 54aa8c4d3616f9bc9d62784180fddc092e4673ae (patch) | |
| tree | f1cd31011b3ea56f680be6ca021872bf3433eb34 /src | |
| parent | 023f14af083bbec8c99ec59f7d7ee9445415c15b (diff) | |
| download | i3bar-mango-54aa8c4d3616f9bc9d62784180fddc092e4673ae.tar.gz | |
fix weird gaps when using non integer font size
Diffstat (limited to 'src')
| -rw-r--r-- | src/text.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/text.rs b/src/text.rs index a1d2e48..1af64ec 100644 --- a/src/text.rs +++ b/src/text.rs @@ -108,7 +108,7 @@ impl ComputedText { } context.save().unwrap(); - context.translate(options.x_offset, 0.0); + context.translate(options.x_offset - 1.0, 0.0); // Set the width/height on the Pango layout so that it word-wraps/ellipises. let text_width = self.width - text.attr.padding_left - text.attr.padding_right; @@ -119,13 +119,13 @@ impl ComputedText { if let Some(bg) = options.bg_color { bg.apply(context); - context.rectangle(0.0, 0.0, self.width, options.bar_height); + context.rectangle(0.0, 0.0, self.width + 1.0, options.bar_height); context.fill().unwrap(); } options.fg_color.apply(context); context.translate( - text.attr.padding_left, + text.attr.padding_left + 1.0, (options.bar_height - self.height) * 0.5, ); show_pango_layout(context, &layout); |
