Files
ladybird/Libraries/LibWeb/Painting/ScrollState.cpp
Aliaksandr Kalenik d6695d7331 LibWeb: Remove unused cumulative_offset from scroll state tracking
The cumulative_offset was being tracked in ScrollStateSnapshot and
ScrollState but was never actually used. This simplifies the code by
removing cumulative_offset_for_frame_with_id() methods and storing
only own_offset values in ScrollStateSnapshot.
2026-01-23 13:18:39 +01:00

21 lines
545 B
C++

/*
* Copyright (c) 2025, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/Painting/ScrollState.h>
namespace Web::Painting {
ScrollStateSnapshot ScrollStateSnapshot::create(Vector<NonnullRefPtr<ScrollFrame>> const& scroll_frames)
{
ScrollStateSnapshot snapshot;
snapshot.own_offsets.ensure_capacity(scroll_frames.size());
for (auto const& scroll_frame : scroll_frames)
snapshot.own_offsets.append({ scroll_frame->own_offset() });
return snapshot;
}
}