summaryrefslogtreecommitdiff
path: root/LibGUI/GPainter.cpp
blob: c5bf01e4a20199445d797b275708d4b6b081d6c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <LibGUI/GPainter.h>
#include <LibGUI/GWidget.h>
#include <LibGUI/GWindow.h>

GPainter::GPainter(GraphicsBitmap& bitmap)
    : Painter(bitmap)
{
}

GPainter::GPainter(GWidget& widget)
    : Painter(*widget.window()->back_bitmap())
{
    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());
}