mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 10:07:15 +02:00
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.
21 lines
545 B
C++
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;
|
|
}
|
|
|
|
}
|