mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-16 23:39:44 +00:00
Everywhere: Hoist the Libraries folder to the top-level
This commit is contained in:
parent
950e819ee7
commit
93712b24bf
Notes:
github-actions[bot]
2024-11-10 11:51:52 +00:00
Author: https://github.com/trflynn89
Commit: 93712b24bf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2256
Reviewed-by: https://github.com/sideshowbarker
4547 changed files with 104 additions and 113 deletions
39
Libraries/LibWeb/Painting/ClipFrame.cpp
Normal file
39
Libraries/LibWeb/Painting/ClipFrame.cpp
Normal file
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/Painting/ClipFrame.h>
|
||||
|
||||
namespace Web::Painting {
|
||||
|
||||
void ClipFrame::add_clip_rect(CSSPixelRect rect, BorderRadiiData radii, RefPtr<ScrollFrame const> enclosing_scroll_frame)
|
||||
{
|
||||
for (auto& existing_clip : m_clip_rects) {
|
||||
if (rect == existing_clip.rect && enclosing_scroll_frame == existing_clip.enclosing_scroll_frame) {
|
||||
existing_clip.corner_radii.union_max_radii(radii);
|
||||
return;
|
||||
}
|
||||
}
|
||||
m_clip_rects.append({ rect, radii, move(enclosing_scroll_frame) });
|
||||
}
|
||||
|
||||
CSSPixelRect ClipFrame::clip_rect_for_hit_testing() const
|
||||
{
|
||||
VERIFY(!m_clip_rects.is_empty());
|
||||
auto rect = m_clip_rects[0].rect;
|
||||
if (m_clip_rects[0].enclosing_scroll_frame) {
|
||||
rect.translate_by(m_clip_rects[0].enclosing_scroll_frame->cumulative_offset());
|
||||
}
|
||||
for (size_t i = 1; i < m_clip_rects.size(); ++i) {
|
||||
auto clip_rect = m_clip_rects[i].rect;
|
||||
if (m_clip_rects[i].enclosing_scroll_frame) {
|
||||
clip_rect.translate_by(m_clip_rects[i].enclosing_scroll_frame->cumulative_offset());
|
||||
}
|
||||
rect.intersect(clip_rect);
|
||||
}
|
||||
return rect;
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue