mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +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
|
@ -681,7 +681,7 @@ void paint_text_fragment(PaintContext& context, TextPaintable const& paintable,
|
|||
auto scale = context.device_pixels_per_css_pixel();
|
||||
painter.draw_text_run(baseline_start.to_type<int>(), *glyph_run, paintable.computed_values().webkit_text_fill_color(), fragment_absolute_device_rect.to_type<int>(), scale, fragment.orientation());
|
||||
|
||||
auto selection_rect = context.enclosing_device_rect(fragment.selection_rect(paintable.layout_node().first_available_font())).to_type<int>();
|
||||
auto selection_rect = context.enclosing_device_rect(fragment.selection_rect()).to_type<int>();
|
||||
if (!selection_rect.is_empty()) {
|
||||
painter.fill_rect(selection_rect, CSS::SystemColor::highlight());
|
||||
DisplayListRecorderStateSaver saver(painter);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue