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

LibWeb: Make PaintContext aware of CSS and DevicePixels

Store the ratio between device and CSS pixels on the PaintContext, so
that it can convert between the two.

Co-authored-by: MacDue <macdue@dueutil.tech>
This commit is contained in:
Sam Atkins 2022-10-26 20:53:41 +01:00 committed by Linus Groh
parent a3298017d6
commit 0be479dcfb
4 changed files with 93 additions and 5 deletions

View file

@ -87,7 +87,7 @@ public:
return;
}
Web::PaintContext context(painter, palette());
Web::PaintContext context(painter, palette(), device_pixels_per_css_pixel());
context.set_should_show_line_box_borders(false);
context.set_viewport_rect(content_rect.to_type<int>());
context.set_has_focus(true);