1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 10:57:35 +00:00

LibWeb: Paint video timestamps using CSS/device pixel-aware scaled fonts

The timestamp text was very tiny on a HiDPI display.
This commit is contained in:
Timothy Flynn 2023-04-22 15:11:29 -04:00 committed by Andreas Kling
parent 848078aedd
commit ab1244a160

View file

@ -300,7 +300,9 @@ DevicePixelRect VideoPaintable::paint_control_bar_timestamp(PaintContext& contex
auto timestamp_rect = control_box_rect; auto timestamp_rect = control_box_rect;
timestamp_rect.set_width(timestamp_size); timestamp_rect.set_width(timestamp_size);
context.painter().draw_text(timestamp_rect.to_type<int>(), timestamp, Gfx::TextAlignment::CenterLeft, Color::White);
auto const& scaled_font = layout_node().scaled_font(context);
context.painter().draw_text(timestamp_rect.to_type<int>(), timestamp, scaled_font, Gfx::TextAlignment::CenterLeft, Color::White);
control_box_rect.take_from_left(timestamp_rect.width()); control_box_rect.take_from_left(timestamp_rect.width());
return control_box_rect; return control_box_rect;