mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 14:07:45 +00:00
Clip painters to widget rect by default to prevent overdraw.
This commit is contained in:
parent
bac9aa90dd
commit
0570bbb6cc
1 changed files with 2 additions and 3 deletions
|
@ -1,5 +1,4 @@
|
||||||
#include "Painter.h"
|
#include "Painter.h"
|
||||||
#include "FrameBuffer.h"
|
|
||||||
#include "Widget.h"
|
#include "Widget.h"
|
||||||
#include "Font.h"
|
#include "Font.h"
|
||||||
#include "Window.h"
|
#include "Window.h"
|
||||||
|
@ -20,8 +19,8 @@ Painter::Painter(Widget& widget)
|
||||||
ASSERT(m_target);
|
ASSERT(m_target);
|
||||||
m_window = widget.window();
|
m_window = widget.window();
|
||||||
m_translation.moveBy(widget.relativePosition());
|
m_translation.moveBy(widget.relativePosition());
|
||||||
m_clip_rect.setWidth(AbstractScreen::the().width());
|
// NOTE: m_clip_rect is in Window coordinates since we are painting into its backing store.
|
||||||
m_clip_rect.setHeight(AbstractScreen::the().height());
|
m_clip_rect = widget.relativeRect();
|
||||||
}
|
}
|
||||||
|
|
||||||
Painter::~Painter()
|
Painter::~Painter()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue