mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 02:47:35 +00:00
LibGfx: Make Painter take the scale factor as constructor argument
I want to give Bitmap an intrinsic scale factor and this is a step in that direction. No behavior change.
This commit is contained in:
parent
7a0bc2fdb8
commit
1382bbfc57
4 changed files with 12 additions and 14 deletions
|
@ -60,11 +60,10 @@ Canvas::Canvas()
|
|||
m_bitmap_1x = Gfx::Bitmap::create(Gfx::BitmapFormat::RGB32, { WIDTH, HEIGHT });
|
||||
m_bitmap_2x = Gfx::Bitmap::create(Gfx::BitmapFormat::RGB32, { WIDTH * 2, HEIGHT * 2 });
|
||||
|
||||
Gfx::Painter painter_1x(*m_bitmap_1x);
|
||||
Gfx::Painter painter_1x(*m_bitmap_1x, 1);
|
||||
draw(painter_1x);
|
||||
|
||||
Gfx::Painter painter_2x(*m_bitmap_2x);
|
||||
painter_2x.scale(2);
|
||||
Gfx::Painter painter_2x(*m_bitmap_2x, 2);
|
||||
draw(painter_2x);
|
||||
|
||||
update();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue