diff --git a/Userland/Libraries/LibGfx/Path.h b/Userland/Libraries/LibGfx/Path.h index f5f3988a83..afda4d00f7 100644 --- a/Userland/Libraries/LibGfx/Path.h +++ b/Userland/Libraries/LibGfx/Path.h @@ -169,10 +169,10 @@ public: }; const NonnullRefPtrVector& segments() const { return m_segments; } - const auto& split_lines() + auto& split_lines() const { if (!m_split_lines.has_value()) { - segmentize_path(); + const_cast(this)->segmentize_path(); VERIFY(m_split_lines.has_value()); } return m_split_lines.value(); @@ -184,10 +184,10 @@ public: m_split_lines.clear(); } - const Gfx::FloatRect& bounding_box() + Gfx::FloatRect const& bounding_box() const { if (!m_bounding_box.has_value()) { - segmentize_path(); + const_cast(this)->segmentize_path(); VERIFY(m_bounding_box.has_value()); } return m_bounding_box.value();