Fix occasional jittery vertical positioning of glyphs

This commit is contained in:
Emil Ernerfeldt 2021-05-28 19:51:10 +02:00
parent 4d56d0328b
commit e6fe6a6f6a

View file

@ -92,6 +92,9 @@ impl FontImpl {
// let height_in_pixels = v.ascent - v.descent + v.line_gap;
// let height_in_points = height_in_pixels / pixels_per_point;
// Round to closest pixel:
let y_offset = (y_offset * pixels_per_point).round() / pixels_per_point;
Self {
rusttype_font,
scale_in_pixels,