summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Duerr <chrisduerr@users.noreply.github.com>2018-11-16 21:28:49 +0000
committerGitHub <noreply@github.com>2018-11-16 21:28:49 +0000
commitea637cde1c82ad971078671aff087236f3fb0fbd (patch)
tree5e09b2ab6004e278fe255427a46afe88dfa15c1e /src
parentd68ecb0deff8b966a0c7d09203d14bfdf5ccd8ad (diff)
downloadalacritty-ea637cde1c82ad971078671aff087236f3fb0fbd.tar.gz
alacritty-ea637cde1c82ad971078671aff087236f3fb0fbd.zip
Fix blurry fonts without dynamic padding
There were some minor rounding issues in the padding codepath without dynamic padding. These have been fixed, which should resolve issues with blurry fonts on monitors with a fractional DPR. This fixes https://github.com/jwilm/alacritty/issues/1806.
Diffstat (limited to 'src')
-rw-r--r--src/display.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/display.rs b/src/display.rs
index 3fe5fbc4..1a145185 100644
--- a/src/display.rs
+++ b/src/display.rs
@@ -330,12 +330,12 @@ impl Display {
let mut padding_y = f32::from(config.padding().y) * dpr as f32;
if config.window().dynamic_padding() {
- padding_x = (padding_x + ((width - 2. * padding_x) % cell_width) / 2.).floor();
- padding_y = (padding_y + ((height - 2. * padding_y) % cell_height) / 2.).floor();
+ padding_x = padding_x + ((width - 2. * padding_x) % cell_width) / 2.;
+ padding_y = padding_y + ((height - 2. * padding_y) % cell_height) / 2.;
}
- self.size_info.padding_x = padding_x;
- self.size_info.padding_y = padding_y;
+ self.size_info.padding_x = padding_x.floor();
+ self.size_info.padding_y = padding_y.floor();
let size = &self.size_info;
terminal.resize(size);
@@ -345,7 +345,7 @@ impl Display {
}
self.window.resize(psize);
- self.renderer.resize(psize, padding_x, padding_y);
+ self.renderer.resize(psize, self.size_info.padding_x, self.size_info.padding_y);
}
}