1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 13:27:34 +00:00

LibWeb: Move text fragment painting to PaintableWithLines

All the other painting code has moved to paintables already.
This commit is contained in:
Andreas Kling 2022-03-16 23:03:18 +01:00
parent 7969161f07
commit be5f0b5ac4
6 changed files with 147 additions and 164 deletions

View file

@ -5,26 +5,14 @@
*/
#include <AK/Utf8View.h>
#include <LibGfx/Painter.h>
#include <LibWeb/Layout/FormattingState.h>
#include <LibWeb/Layout/InitialContainingBlock.h>
#include <LibWeb/Layout/LineBoxFragment.h>
#include <LibWeb/Layout/TextNode.h>
#include <LibWeb/Painting/PaintContext.h>
#include <ctype.h>
namespace Web::Layout {
void LineBoxFragment::paint(PaintContext& context, Painting::PaintPhase phase)
{
for (auto* ancestor = layout_node().parent(); ancestor; ancestor = ancestor->parent()) {
if (!ancestor->is_visible())
return;
}
layout_node().paint_fragment(context, *this, phase);
}
bool LineBoxFragment::ends_in_whitespace() const
{
auto text = this->text();