LibWeb/Painting: Use GlyphRun font for measuring selection rectangle

We incorrectly used the first available font to measure this before,
which may or may not be the correct font for this text.
This commit is contained in:
Sam Atkins 2024-12-05 17:54:05 +00:00 committed by Alexander Kalenik
commit e457252c97
Notes: github-actions[bot] 2024-12-06 01:58:40 +00:00
4 changed files with 10 additions and 9 deletions

View file

@ -39,8 +39,8 @@ public:
RefPtr<Gfx::GlyphRun> glyph_run() const { return m_glyph_run; }
Gfx::Orientation orientation() const;
CSSPixelRect selection_rect(Gfx::Font const&) const;
CSSPixelRect range_rect(Gfx::Font const&, size_t start_offset, size_t end_offset) const;
CSSPixelRect selection_rect() const;
CSSPixelRect range_rect(size_t start_offset, size_t end_offset) const;
CSSPixels width() const { return m_size.width(); }
CSSPixels height() const { return m_size.height(); }