1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-09-16 00:36:17 +00:00

LibWeb: Apply CSS scaling to SVG elements

Not sure why this was not done before, not now it works easily :^)
This commit is contained in:
MacDue 2023-04-10 12:34:39 +01:00 committed by Andreas Kling
parent cf23a2b82d
commit d0496ae9b8
5 changed files with 18 additions and 7 deletions

View file

@ -67,6 +67,14 @@ DevicePixelPoint PaintContext::rounded_device_point(CSSPixelPoint point) const
};
}
DevicePixelPoint PaintContext::floored_device_point(CSSPixelPoint point) const
{
return {
floorf(point.x().value() * m_device_pixels_per_css_pixel),
floorf(point.y().value() * m_device_pixels_per_css_pixel)
};
}
DevicePixelRect PaintContext::enclosing_device_rect(CSSPixelRect rect) const
{
return {