Skip to content

Commit

Permalink
Attempt at fixing #85, but still have visual artifacts.
Browse files Browse the repository at this point in the history
Based off of Neovim-gtk's fix:
daa84/neovim-gtk@482d9c7
  • Loading branch information
smolck committed Dec 1, 2019
1 parent 65846f4 commit b48a1cd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ui/grid/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,10 @@ impl CellMetrics {
.get_metrics(Some(&self.font.as_pango_font()), None)
.unwrap();
let extra = self.line_space as f64 / 2.0;
self.ascent = fm.get_ascent() as f64 / pango::SCALE as f64 + extra;
self.decent = fm.get_descent() as f64 / pango::SCALE as f64 + extra;
self.height = self.ascent + self.decent;
self.width = (fm.get_approximate_digit_width() / pango::SCALE) as f64;
self.ascent = (fm.get_ascent() as f64 / pango::SCALE as f64 + extra).ceil();
self.decent = (fm.get_descent() as f64 / pango::SCALE as f64 + extra).ceil();
self.height = self.ascent + self.decent + self.line_space as f64;
self.width = fm.get_approximate_char_width() as f64 / pango::SCALE as f64;

self.underline_position =
fm.get_underline_position() as f64 / pango::SCALE as f64 - extra;
Expand Down

0 comments on commit b48a1cd

Please sign in to comment.