Fix calculation of visible glyph bounds

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra 2021-09-02 16:24:52 +02:00
parent 26fe285408
commit 2d5abee655

View file

@ -272,7 +272,7 @@ impl Line {
let mut color_end = 0;
let mut color = Color::black();
let mut glyph_origin = baseline_origin;
let mut glyph_origin = vec2f(0., 0.);
let mut prev_position = 0.;
for run in &self.layout.runs {
for (glyph_ix, glyph) in run.glyphs.iter().enumerate() {
@ -304,7 +304,7 @@ impl Line {
font_id: run.font_id,
font_size: self.layout.font_size,
id: glyph.id,
origin: origin + glyph_origin,
origin: glyph_bounds.origin() + baseline_origin,
color,
});
}