mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:27:35 +00:00
LibWeb: Implement converting a DevicePixelRect to a CSSPixelRect
Which also requires converting a DevicePixelSize to a CSSPixelSize.
This commit is contained in:
parent
5a98a5529f
commit
c4e3ba2dfb
2 changed files with 18 additions and 0 deletions
|
@ -124,4 +124,20 @@ CSSPixelPoint PaintContext::scale_to_css_point(DevicePixelPoint point) const
|
|||
};
|
||||
}
|
||||
|
||||
CSSPixelSize PaintContext::scale_to_css_size(DevicePixelSize size) const
|
||||
{
|
||||
return {
|
||||
scale_to_css_pixels(size.width()),
|
||||
scale_to_css_pixels(size.height())
|
||||
};
|
||||
}
|
||||
|
||||
CSSPixelRect PaintContext::scale_to_css_rect(DevicePixelRect rect) const
|
||||
{
|
||||
return {
|
||||
scale_to_css_point(rect.location()),
|
||||
scale_to_css_size(rect.size())
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue