mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
381dcca2f6
This reverts commit ff76a5b8d2
.
28 lines
645 B
C++
28 lines
645 B
C++
/*
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <LibGUI/Painter.h>
|
|
#include <LibGUI/Widget.h>
|
|
#include <LibGUI/Window.h>
|
|
#include <LibGfx/Bitmap.h>
|
|
|
|
namespace GUI {
|
|
Painter::Painter(Gfx::Bitmap& bitmap)
|
|
: Gfx::Painter(bitmap)
|
|
{
|
|
}
|
|
|
|
Painter::Painter(Widget& 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.intersected(m_target->rect());
|
|
m_clip_origin = state().clip_rect;
|
|
}
|
|
|
|
}
|