2024-04-27 14:26:42 +02:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2024, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <LibWeb/Painting/ClippableAndScrollable.h>
|
|
|
|
|
|
|
|
namespace Web::Painting {
|
|
|
|
|
|
|
|
Optional<int> ClippableAndScrollable::scroll_frame_id() const
|
|
|
|
{
|
|
|
|
if (m_enclosing_scroll_frame)
|
|
|
|
return m_enclosing_scroll_frame->id;
|
|
|
|
return {};
|
|
|
|
}
|
|
|
|
|
2024-08-07 18:04:05 +03:00
|
|
|
CSSPixelPoint ClippableAndScrollable::enclosing_scroll_frame_offset() const
|
2024-04-27 14:26:42 +02:00
|
|
|
{
|
|
|
|
if (m_enclosing_scroll_frame)
|
|
|
|
return m_enclosing_scroll_frame->offset;
|
|
|
|
return {};
|
|
|
|
}
|
|
|
|
|
|
|
|
Optional<CSSPixelRect> ClippableAndScrollable::clip_rect() const
|
|
|
|
{
|
2024-07-31 22:26:43 +03:00
|
|
|
if (m_enclosing_clip_frame)
|
|
|
|
return m_enclosing_clip_frame->rect();
|
2024-04-27 14:26:42 +02:00
|
|
|
return {};
|
|
|
|
}
|
|
|
|
|
|
|
|
Span<BorderRadiiClip const> ClippableAndScrollable::border_radii_clips() const
|
|
|
|
{
|
|
|
|
if (m_enclosing_clip_frame)
|
|
|
|
return m_enclosing_clip_frame->border_radii_clips();
|
|
|
|
return {};
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|