summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Painting/PaintContext.h
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2022-10-27 14:37:05 +0100
committerLinus Groh <mail@linusgroh.de>2022-12-14 16:47:57 +0000
commit4440af087048874952c9ba7d53d479424068acc2 (patch)
treef091c47f58f70b518eae34e829845916631928c3 /Userland/Libraries/LibWeb/Painting/PaintContext.h
parent0be479dcfb766b7e931d266989b1556db577b5c8 (diff)
downloadserenity-4440af087048874952c9ba7d53d479424068acc2.zip
LibWeb: Split PaintContext::viewport_rect() into device/css variants
For now, everyone uses `device_viewport_rect()`, until I convert them.
Diffstat (limited to 'Userland/Libraries/LibWeb/Painting/PaintContext.h')
-rw-r--r--Userland/Libraries/LibWeb/Painting/PaintContext.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/Userland/Libraries/LibWeb/Painting/PaintContext.h b/Userland/Libraries/LibWeb/Painting/PaintContext.h
index 511a789287..32128bbc57 100644
--- a/Userland/Libraries/LibWeb/Painting/PaintContext.h
+++ b/Userland/Libraries/LibWeb/Painting/PaintContext.h
@@ -31,8 +31,9 @@ public:
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; }
- Gfx::IntRect viewport_rect() const { return m_viewport_rect; }
- void set_viewport_rect(Gfx::IntRect const& rect) { m_viewport_rect = rect; }
+ DevicePixelRect device_viewport_rect() const { return m_device_viewport_rect; }
+ void set_device_viewport_rect(DevicePixelRect const& rect) { m_device_viewport_rect = rect; }
+ CSSPixelRect css_viewport_rect() const;
bool has_focus() const { return m_focus; }
void set_has_focus(bool focus) { m_focus = focus; }
@@ -51,7 +52,7 @@ public:
PaintContext clone(Gfx::Painter& painter) const
{
auto clone = PaintContext(painter, m_palette, m_device_pixels_per_css_pixel);
- clone.m_viewport_rect = m_viewport_rect;
+ clone.m_device_viewport_rect = m_device_viewport_rect;
clone.m_should_show_line_box_borders = m_should_show_line_box_borders;
clone.m_focus = m_focus;
clone.m_svg_context = m_svg_context;
@@ -63,7 +64,7 @@ private:
Palette m_palette;
Optional<SVGContext> m_svg_context;
float m_device_pixels_per_css_pixel;
- Gfx::IntRect m_viewport_rect;
+ DevicePixelRect m_device_viewport_rect;
bool m_should_show_line_box_borders { false };
bool m_focus { false };
};