mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 12:57:34 +00:00
LibWeb: Use the new Gfx::Painter::draw_text_run() API for drawing text
This avoids a bunch of unnecessary work in Painter which not only took time, but sometimes also led to alignment issues. draw_text_run() will draw the text where we tell it, and that's it.
This commit is contained in:
parent
dd940dfa85
commit
1c88536298
4 changed files with 16 additions and 9 deletions
|
@ -159,7 +159,8 @@ void paint_text_shadow(PaintContext& context, Layout::LineBoxFragment const& fra
|
|||
Gfx::Painter shadow_painter { *shadow_bitmap };
|
||||
shadow_painter.set_font(context.painter().font());
|
||||
// FIXME: "Spread" the shadow somehow.
|
||||
shadow_painter.draw_text(text_rect, fragment.text(), Gfx::TextAlignment::CenterLeft, layer.color);
|
||||
Gfx::FloatPoint baseline_start(text_rect.x(), text_rect.y() + fragment.baseline());
|
||||
shadow_painter.draw_text_run(baseline_start, Utf8View(fragment.text()), context.painter().font(), layer.color);
|
||||
|
||||
// Blur
|
||||
Gfx::FastBoxBlurFilter filter(*shadow_bitmap);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue