mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:57:45 +00:00
LibWeb: Split PaintContext::viewport_rect() into device/css variants
For now, everyone uses `device_viewport_rect()`, until I convert them.
This commit is contained in:
parent
0be479dcfb
commit
4440af0870
8 changed files with 24 additions and 13 deletions
|
@ -34,6 +34,16 @@ void PaintContext::clear_svg_context()
|
|||
m_svg_context.clear();
|
||||
}
|
||||
|
||||
CSSPixelRect PaintContext::css_viewport_rect() const
|
||||
{
|
||||
return {
|
||||
m_device_viewport_rect.x().value() / m_device_pixels_per_css_pixel,
|
||||
m_device_viewport_rect.y().value() / m_device_pixels_per_css_pixel,
|
||||
m_device_viewport_rect.width().value() / m_device_pixels_per_css_pixel,
|
||||
m_device_viewport_rect.height().value() / m_device_pixels_per_css_pixel
|
||||
};
|
||||
}
|
||||
|
||||
DevicePixels PaintContext::rounded_device_pixels(CSSPixels css_pixels) const
|
||||
{
|
||||
return roundf(css_pixels.value() * m_device_pixels_per_css_pixel);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue