mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:47:35 +00:00
LibGfx: Use round_to<int> in Painter::draw_text_line
This commit is contained in:
parent
d866637074
commit
9aa4958234
1 changed files with 2 additions and 2 deletions
|
@ -1387,7 +1387,7 @@ void draw_text_line(IntRect const& a_rect, Utf8View const& text, Font const& fon
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
int kerning = static_cast<int>(lroundf(font.glyphs_horizontal_kerning(last_code_point, code_point)));
|
int kerning = round_to<int>(font.glyphs_horizontal_kerning(last_code_point, code_point));
|
||||||
if (kerning != 0.f)
|
if (kerning != 0.f)
|
||||||
point.translate_by(direction == TextDirection::LTR ? kerning : -kerning, 0);
|
point.translate_by(direction == TextDirection::LTR ? kerning : -kerning, 0);
|
||||||
|
|
||||||
|
@ -2334,7 +2334,7 @@ void Painter::draw_text_run(FloatPoint const& baseline_start, Utf8View const& st
|
||||||
|
|
||||||
// FIXME: this is probably not the real space taken for complex emojis
|
// FIXME: this is probably not the real space taken for complex emojis
|
||||||
x += font.glyphs_horizontal_kerning(last_code_point, code_point);
|
x += font.glyphs_horizontal_kerning(last_code_point, code_point);
|
||||||
draw_glyph_or_emoji({ static_cast<int>(lroundf(x)), y }, code_point_iterator, font, color);
|
draw_glyph_or_emoji({ round_to<int>(x), y }, code_point_iterator, font, color);
|
||||||
x += font.glyph_or_emoji_width(code_point) + font.glyph_spacing();
|
x += font.glyph_or_emoji_width(code_point) + font.glyph_spacing();
|
||||||
last_code_point = code_point;
|
last_code_point = code_point;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue