summaryrefslogtreecommitdiff
path: root/Widgets/Painter.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-01-12 17:08:02 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-01-12 17:08:45 +0100
commit0570bbb6cc1237bbd7d4e96d6173752454ec8624 (patch)
treef10ba32285bccb78a21e57033a3638ea9a950e18 /Widgets/Painter.cpp
parentbac9aa90ddb6a31fab75fc26c3f0bed2df04b5cd (diff)
downloadserenity-0570bbb6cc1237bbd7d4e96d6173752454ec8624.zip
Clip painters to widget rect by default to prevent overdraw.
Diffstat (limited to 'Widgets/Painter.cpp')
-rw-r--r--Widgets/Painter.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/Widgets/Painter.cpp b/Widgets/Painter.cpp
index aec4d9e511..c702f1dee1 100644
--- a/Widgets/Painter.cpp
+++ b/Widgets/Painter.cpp
@@ -1,5 +1,4 @@
#include "Painter.h"
-#include "FrameBuffer.h"
#include "Widget.h"
#include "Font.h"
#include "Window.h"
@@ -20,8 +19,8 @@ Painter::Painter(Widget& widget)
ASSERT(m_target);
m_window = widget.window();
m_translation.moveBy(widget.relativePosition());
- m_clip_rect.setWidth(AbstractScreen::the().width());
- m_clip_rect.setHeight(AbstractScreen::the().height());
+ // NOTE: m_clip_rect is in Window coordinates since we are painting into its backing store.
+ m_clip_rect = widget.relativeRect();
}
Painter::~Painter()