mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:27:43 +00:00
Breakout: Paint ball antialiased
This commit is contained in:
parent
6b85b358f8
commit
e2de02d2bb
1 changed files with 3 additions and 1 deletions
|
@ -11,6 +11,7 @@
|
|||
#include <LibGUI/Application.h>
|
||||
#include <LibGUI/MessageBox.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGfx/AntiAliasingPainter.h>
|
||||
#include <LibGfx/StandardCursor.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
@ -124,10 +125,11 @@ void Game::paint_event(GUI::PaintEvent& event)
|
|||
{
|
||||
GUI::Painter painter(*this);
|
||||
painter.add_clip_rect(event.rect());
|
||||
Gfx::AntiAliasingPainter aa_painter { painter };
|
||||
|
||||
painter.fill_rect(rect(), Color::Black);
|
||||
|
||||
painter.fill_ellipse(enclosing_int_rect(m_ball.rect()), Color::Red);
|
||||
aa_painter.fill_ellipse(enclosing_int_rect(m_ball.rect()), Color::Red);
|
||||
|
||||
painter.fill_rect(enclosing_int_rect(m_paddle.rect), Color::White);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue