diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2022-10-24 12:59:24 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-12-10 12:03:19 +0000 |
commit | d3476c28bafcf64643d0d306d9d03ec81464867a (patch) | |
tree | ea291a507ed298ea3a91cb57cd097f36f853fab4 | |
parent | 3c7bd5a317515ac572610eba2919c82dcd320a1e (diff) | |
download | serenity-d3476c28bafcf64643d0d306d9d03ec81464867a.zip |
LibWeb+WebContent+headless-browser: Remove PaintContext::scroll_offset()
Nobody uses this. They get the scroll_offset from the BlockContainer
instead.
-rw-r--r-- | Userland/Libraries/LibWeb/Painting/PaintContext.cpp | 3 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/Painting/PaintContext.h | 7 | ||||
-rw-r--r-- | Userland/Services/WebContent/PageHost.cpp | 2 | ||||
-rw-r--r-- | Userland/Utilities/headless-browser.cpp | 2 |
4 files changed, 5 insertions, 9 deletions
diff --git a/Userland/Libraries/LibWeb/Painting/PaintContext.cpp b/Userland/Libraries/LibWeb/Painting/PaintContext.cpp index 014c56e844..c907a5c8de 100644 --- a/Userland/Libraries/LibWeb/Painting/PaintContext.cpp +++ b/Userland/Libraries/LibWeb/Painting/PaintContext.cpp @@ -8,10 +8,9 @@ namespace Web { -PaintContext::PaintContext(Gfx::Painter& painter, Palette const& palette, Gfx::IntPoint scroll_offset) +PaintContext::PaintContext(Gfx::Painter& painter, Palette const& palette) : m_painter(painter) , m_palette(palette) - , m_scroll_offset(scroll_offset) { } diff --git a/Userland/Libraries/LibWeb/Painting/PaintContext.h b/Userland/Libraries/LibWeb/Painting/PaintContext.h index d8bea98414..5024eebb16 100644 --- a/Userland/Libraries/LibWeb/Painting/PaintContext.h +++ b/Userland/Libraries/LibWeb/Painting/PaintContext.h @@ -16,7 +16,7 @@ namespace Web { class PaintContext { public: - PaintContext(Gfx::Painter& painter, Palette const& palette, Gfx::IntPoint scroll_offset); + PaintContext(Gfx::Painter& painter, Palette const& palette); Gfx::Painter& painter() const { return m_painter; } Palette const& palette() const { return m_palette; } @@ -32,14 +32,12 @@ public: Gfx::IntRect viewport_rect() const { return m_viewport_rect; } void set_viewport_rect(Gfx::IntRect const& rect) { m_viewport_rect = rect; } - Gfx::IntPoint scroll_offset() const { return m_scroll_offset; } - bool has_focus() const { return m_focus; } void set_has_focus(bool focus) { m_focus = focus; } PaintContext clone(Gfx::Painter& painter) const { - auto clone = PaintContext(painter, m_palette, m_scroll_offset); + auto clone = PaintContext(painter, m_palette); clone.m_viewport_rect = m_viewport_rect; clone.m_should_show_line_box_borders = m_should_show_line_box_borders; clone.m_focus = m_focus; @@ -52,7 +50,6 @@ private: Palette m_palette; Optional<SVGContext> m_svg_context; Gfx::IntRect m_viewport_rect; - Gfx::IntPoint m_scroll_offset; bool m_should_show_line_box_borders { false }; bool m_focus { false }; }; diff --git a/Userland/Services/WebContent/PageHost.cpp b/Userland/Services/WebContent/PageHost.cpp index 71e4ffc5a3..7d634bb66b 100644 --- a/Userland/Services/WebContent/PageHost.cpp +++ b/Userland/Services/WebContent/PageHost.cpp @@ -118,7 +118,7 @@ void PageHost::paint(Web::DevicePixelRect const& content_rect, Gfx::Bitmap& targ return; } - Web::PaintContext context(painter, palette(), content_rect.top_left().to_type<int>()); + Web::PaintContext context(painter, palette()); context.set_should_show_line_box_borders(m_should_show_line_box_borders); context.set_viewport_rect(content_rect.to_type<int>()); context.set_has_focus(m_has_focus); diff --git a/Userland/Utilities/headless-browser.cpp b/Userland/Utilities/headless-browser.cpp index de7e0569be..1310932f85 100644 --- a/Userland/Utilities/headless-browser.cpp +++ b/Userland/Utilities/headless-browser.cpp @@ -87,7 +87,7 @@ public: return; } - Web::PaintContext context(painter, palette(), content_rect.top_left().to_type<int>()); + Web::PaintContext context(painter, palette()); context.set_should_show_line_box_borders(false); context.set_viewport_rect(content_rect.to_type<int>()); context.set_has_focus(true); |