mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-23 17:52:26 -05:00
ffbe975ffc
We were lugging around a reference to a temporary here.
30 lines
832 B
C++
30 lines
832 B
C++
#pragma once
|
|
|
|
#include <LibDraw/Palette.h>
|
|
#include <LibDraw/Rect.h>
|
|
|
|
class GPainter;
|
|
|
|
class RenderingContext {
|
|
public:
|
|
explicit RenderingContext(GPainter& painter, const Palette& palette)
|
|
: m_painter(painter)
|
|
, m_palette(palette)
|
|
{
|
|
}
|
|
|
|
GPainter& painter() const { return m_painter; }
|
|
const Palette& palette() const { return m_palette; }
|
|
|
|
bool should_show_line_box_borders() const { return m_should_show_line_box_borders; }
|
|
void set_should_show_line_box_borders(bool value) { m_should_show_line_box_borders = value; }
|
|
|
|
Rect viewport_rect() const { return m_viewport_rect; }
|
|
void set_viewport_rect(const Rect& rect) { m_viewport_rect = rect; }
|
|
|
|
private:
|
|
GPainter& m_painter;
|
|
Palette m_palette;
|
|
Rect m_viewport_rect;
|
|
bool m_should_show_line_box_borders { false };
|
|
};
|