2025-04-11 15:00:56 -03:00
|
|
|
/*
|
|
|
|
|
* 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;
|
2026-01-22 17:08:10 -03:00
|
|
|
snapshot.own_offsets.ensure_capacity(scroll_frames.size());
|
2025-04-11 15:00:56 -03:00
|
|
|
for (auto const& scroll_frame : scroll_frames)
|
2026-02-01 11:32:59 -03:00
|
|
|
snapshot.own_offsets.append({ scroll_frame->m_own_offset });
|
2025-04-11 15:00:56 -03:00
|
|
|
return snapshot;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|