mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:38:11 +00:00
LibGUI: Add a GPainter class that inherits from Painter.
This gets rid of the last little piece of LibGUI knowledge in Painter.
This commit is contained in:
parent
326c6fd607
commit
9fa21fa585
27 changed files with 75 additions and 78 deletions
|
@ -4,16 +4,6 @@
|
|||
#include <SharedGraphics/CharacterBitmap.h>
|
||||
#include <AK/Assertions.h>
|
||||
#include <AK/StdLibExtras.h>
|
||||
|
||||
#ifdef LIBGUI
|
||||
#include <LibGUI/GWidget.h>
|
||||
#include <LibGUI/GWindow.h>
|
||||
#include <LibGUI/GEventLoop.h>
|
||||
#include <LibC/stdio.h>
|
||||
#include <LibC/errno.h>
|
||||
#include <LibC/string.h>
|
||||
#endif
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
Painter::Painter(GraphicsBitmap& bitmap)
|
||||
|
@ -25,22 +15,6 @@ Painter::Painter(GraphicsBitmap& bitmap)
|
|||
m_clip_origin = state().clip_rect;
|
||||
}
|
||||
|
||||
#ifdef LIBGUI
|
||||
Painter::Painter(GWidget& widget)
|
||||
: m_window(widget.window())
|
||||
, m_target(*m_window->back_bitmap())
|
||||
{
|
||||
m_state_stack.append(State());
|
||||
state().font = &widget.font();
|
||||
|
||||
auto origin_rect = widget.window_relative_rect();
|
||||
state().translation = origin_rect.location();
|
||||
state().clip_rect = origin_rect;
|
||||
m_clip_origin = origin_rect;
|
||||
state().clip_rect.intersect(m_target->rect());
|
||||
}
|
||||
#endif
|
||||
|
||||
Painter::~Painter()
|
||||
{
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue