1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:48:12 +00:00

LibGfx: Add directional floating-point scaling to Painter

This allows the painter to be scaled separately in both directions, and
not just in integer intervals. This is crucial for proper SVG viewBox
support.

Most bitmap-related things verify the scale to be one as of now.
This commit is contained in:
Matthew Olsson 2021-04-20 11:07:19 -07:00 committed by Andreas Kling
parent 88cfaf7bf0
commit ff76a5b8d2
4 changed files with 110 additions and 143 deletions

View file

@ -20,7 +20,7 @@ Painter::Painter(Widget& widget)
{
state().font = &widget.font();
auto origin_rect = widget.window_relative_rect();
state().translation = origin_rect.location();
translate(origin_rect.location());
state().clip_rect = origin_rect.intersected(m_target->rect());
m_clip_origin = state().clip_rect;
}