Position underlines at a distance proportional to the line descent

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra 2022-01-26 16:03:06 +01:00
parent b9b255652f
commit 3f6960bd34

View file

@ -272,7 +272,13 @@ impl Line {
}
}
if let Some(run_underline) = run_underline {
underline.get_or_insert((glyph_origin, *run_underline));
underline.get_or_insert((
vec2f(
glyph_origin.x(),
origin.y() + baseline_offset.y() + 0.618 * self.layout.descent,
),
*run_underline,
));
}
run_end += *run_len as usize;