mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-28 18:47:15 +02:00
Remove the public own_offset() getter from ScrollFrame and the own_offset_for_frame_with_id() helper from ScrollState. The snapshot creation in ScrollStateSnapshot now accesses m_own_offset directly through a friend declaration. This ensures scroll offsets in the painting pipeline are only read through snapshots.
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->m_own_offset });
|
|
return snapshot;
|
|
}
|
|
|
|
}
|