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:
parent
88cfaf7bf0
commit
ff76a5b8d2
4 changed files with 110 additions and 143 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue