summaryrefslogtreecommitdiff
path: root/Userland/Games/Breakout/Game.cpp
diff options
context:
space:
mode:
authorMacDue <macdue@dueutil.tech>2022-06-05 14:43:07 +0100
committerLinus Groh <mail@linusgroh.de>2022-06-05 16:16:17 +0100
commite2de02d2bb2cdfd0c5bb4f3f2ddbd5f9d9f7aa01 (patch)
tree6f9a882a4aecfb478960fcd630c37a843795385e /Userland/Games/Breakout/Game.cpp
parent6b85b358f8fa7ab0c945202cb9c7a8c3d348e7b1 (diff)
downloadserenity-e2de02d2bb2cdfd0c5bb4f3f2ddbd5f9d9f7aa01.zip
Breakout: Paint ball antialiased
Diffstat (limited to 'Userland/Games/Breakout/Game.cpp')
-rw-r--r--Userland/Games/Breakout/Game.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/Userland/Games/Breakout/Game.cpp b/Userland/Games/Breakout/Game.cpp
index 134c7c979e..4d0e63f231 100644
--- a/Userland/Games/Breakout/Game.cpp
+++ b/Userland/Games/Breakout/Game.cpp
@@ -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);