From 149fbaef09a56613c72855bc60355c7848256500 Mon Sep 17 00:00:00 2001 From: Joe Wilm Date: Wed, 3 May 2017 15:12:23 -0700 Subject: Fix glyph offsets in cell We previously had a hard-coded value for aligning glyphs within cells. The font descent is now used, and the offset should be correct by default. --- src/term/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/term/mod.rs') diff --git a/src/term/mod.rs b/src/term/mod.rs index 9981a3d1..4891e794 100644 --- a/src/term/mod.rs +++ b/src/term/mod.rs @@ -556,12 +556,12 @@ pub struct SizeInfo { impl SizeInfo { #[inline] pub fn lines(&self) -> Line { - Line((self.height / self.cell_height) as usize) + Line(((self.height - 4.0) / self.cell_height) as usize) } #[inline] pub fn cols(&self) -> Column { - Column((self.width / self.cell_width) as usize) + Column(((self.width - 4.0) / self.cell_width) as usize) } pub fn pixels_to_coords(&self, x: usize, y: usize) -> Option { -- cgit