mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:47:44 +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:
parent
a3298017d6
commit
0be479dcfb
4 changed files with 93 additions and 5 deletions
|
@ -118,7 +118,7 @@ void PageHost::paint(Web::DevicePixelRect const& content_rect, Gfx::Bitmap& targ
|
|||
return;
|
||||
}
|
||||
|
||||
Web::PaintContext context(painter, palette());
|
||||
Web::PaintContext context(painter, palette(), device_pixels_per_css_pixel());
|
||||
context.set_should_show_line_box_borders(m_should_show_line_box_borders);
|
||||
context.set_viewport_rect(content_rect.to_type<int>());
|
||||
context.set_has_focus(m_has_focus);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue