Fix clipping in Line::draw

Co-Authored-By: Nathan <nathan@zed.dev>
Co-Authored-By: Marshall <marshall@zed.dev>
This commit is contained in:
Antonio Scandurra 2023-11-08 17:32:21 +01:00
parent 727fb4fbff
commit d71f671476

View File

@ -74,7 +74,6 @@ impl Line {
glyph_origin.y += line_height; glyph_origin.y += line_height;
} }
prev_glyph_position = glyph.position; prev_glyph_position = glyph.position;
let glyph_origin = glyph_origin + baseline_offset;
let mut finished_underline: Option<(Point<Pixels>, UnderlineStyle)> = None; let mut finished_underline: Option<(Point<Pixels>, UnderlineStyle)> = None;
if glyph.index >= run_end { if glyph.index >= run_end {
@ -125,14 +124,14 @@ impl Line {
if max_glyph_bounds.intersects(&content_mask.bounds) { if max_glyph_bounds.intersects(&content_mask.bounds) {
if glyph.is_emoji { if glyph.is_emoji {
cx.paint_emoji( cx.paint_emoji(
glyph_origin, glyph_origin + baseline_offset,
run.font_id, run.font_id,
glyph.id, glyph.id,
self.layout.layout.font_size, self.layout.layout.font_size,
)?; )?;
} else { } else {
cx.paint_glyph( cx.paint_glyph(
glyph_origin, glyph_origin + baseline_offset,
run.font_id, run.font_id,
glyph.id, glyph.id,
self.layout.layout.font_size, self.layout.layout.font_size,