aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Wilm <jwilm@users.noreply.github.com>2017-10-17 10:15:24 -0700
committerGitHub <noreply@github.com>2017-10-17 10:15:24 -0700
commit5ac42bb13bc68c5cbc44869dc9fc9ac19402a6e6 (patch)
treecebd883c66f163ff2def19e04757f8a31fc3aa62
parentd3151dfbf99e64fd5855d0e0ce5be119410ba293 (diff)
downloadalacritty-5ac42bb13bc68c5cbc44869dc9fc9ac19402a6e6.tar.gz
alacritty-5ac42bb13bc68c5cbc44869dc9fc9ac19402a6e6.zip
Fix render issues on macOS (#845)
Parts of neighboring glyphs in the atlas were being rendered incorrectly. The issue is resolved by aligning cells to the pixel grid. This behavior was achieved previously by first applying integer truncation before casting to a float. Fixes #844.
-rw-r--r--src/display.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/display.rs b/src/display.rs
index eb562e8f..bdd9a9f2 100644
--- a/src/display.rs
+++ b/src/display.rs
@@ -247,8 +247,8 @@ impl Display {
});
let metrics = cache.font_metrics();
- self.size_info.cell_width = (metrics.average_advance + config.font().offset().x as f64) as f32;
- self.size_info.cell_height = (metrics.line_height + config.font().offset().y as f64) as f32;
+ self.size_info.cell_width = ((metrics.average_advance + config.font().offset().x as f64) as f32).floor();
+ self.size_info.cell_height = ((metrics.line_height + config.font().offset().y as f64) as f32).floor();
}
#[inline]