diff options
author | Matt Purnell <matt.purnell98@gmail.com> | 2022-12-17 19:24:02 -0600 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-12-18 12:56:33 +0100 |
commit | 0bda06c9c51331514c2c58045668877be4cb5653 (patch) | |
tree | 85b0cf700583afec84ab0f97c6f9957f2c93b760 /Userland/Libraries/LibWeb | |
parent | 28ad49bcbdad8202647c083088f4064e61c7dbc4 (diff) | |
download | serenity-0bda06c9c51331514c2c58045668877be4cb5653.zip |
LibWeb: Don't const_cast layout_box() when calling const functions
layout_box() already has a non-const overload, so we don't need to
const_cast them anymore. This gets rid of 2 FIXMEs. :^)
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r-- | Userland/Libraries/LibWeb/Painting/PaintableBox.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp b/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp index d09f20dc19..43a9092f86 100644 --- a/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp +++ b/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp @@ -58,15 +58,13 @@ PaintableWithLines::~PaintableWithLines() void PaintableBox::set_offset(CSSPixelPoint offset) { m_offset = offset; - // FIXME: This const_cast is gross. - const_cast<Layout::Box&>(layout_box()).did_set_rect(); + layout_box().did_set_rect(); } void PaintableBox::set_content_size(CSSPixelSize size) { m_content_size = size; - // FIXME: This const_cast is gross. - const_cast<Layout::Box&>(layout_box()).did_set_rect(); + layout_box().did_set_rect(); } CSSPixelPoint PaintableBox::effective_offset() const @@ -647,7 +645,7 @@ bool PaintableWithLines::handle_mousewheel(Badge<EventHandler>, CSSPixelPoint, u return false; auto new_offset = layout_box().scroll_offset(); new_offset.translate_by(wheel_delta_x, wheel_delta_y); - const_cast<Layout::BlockContainer&>(layout_box()).set_scroll_offset(new_offset); + layout_box().set_scroll_offset(new_offset); return true; } |