mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
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:
parent
7a0c675f45
commit
e457252c97
Notes:
github-actions[bot]
2024-12-06 01:58:40 +00:00
Author: https://github.com/AtkinsSJ
Commit: e457252c97
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2796
4 changed files with 10 additions and 9 deletions
|
@ -1199,9 +1199,8 @@ GC::Ref<Geometry::DOMRectList> Range::get_client_rects()
|
|||
if (is<Painting::PaintableWithLines>(*containing_block)) {
|
||||
auto const& paintable_lines = static_cast<Painting::PaintableWithLines const&>(*containing_block);
|
||||
auto fragments = paintable_lines.fragments();
|
||||
auto const& font = paintable->layout_node().first_available_font();
|
||||
for (auto frag = fragments.begin(); frag != fragments.end(); frag++) {
|
||||
auto rect = frag->range_rect(font, start_offset(), end_offset());
|
||||
auto rect = frag->range_rect(start_offset(), end_offset());
|
||||
if (rect.is_empty())
|
||||
continue;
|
||||
rects.append(Geometry::DOMRect::create(realm(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue