mirror of
https://github.com/RGBCube/serenity
synced 2025-07-05 10:07:34 +00:00
LibWeb: Paint line box fragments during all paint phases
Fragment painting was very limited by only being called during the foreground paint phase. We now paint fragments as part of every phase (and the phase is passed to paint_fragment() of course!)
This commit is contained in:
parent
d129e68da8
commit
311e1039b5
5 changed files with 47 additions and 45 deletions
|
@ -57,17 +57,15 @@ void BlockBox::paint(PaintContext& context, PaintPhase phase)
|
|||
if (!children_are_inline())
|
||||
return;
|
||||
|
||||
// FIXME: Inline backgrounds etc.
|
||||
if (phase == PaintPhase::Foreground) {
|
||||
for (auto& line_box : m_line_boxes) {
|
||||
for (auto& fragment : line_box.fragments()) {
|
||||
if (context.should_show_line_box_borders())
|
||||
context.painter().draw_rect(enclosing_int_rect(fragment.absolute_rect()), Color::Green);
|
||||
fragment.paint(context);
|
||||
}
|
||||
for (auto& line_box : m_line_boxes) {
|
||||
for (auto& fragment : line_box.fragments()) {
|
||||
if (context.should_show_line_box_borders())
|
||||
context.painter().draw_rect(enclosing_int_rect(fragment.absolute_rect()), Color::Green);
|
||||
fragment.paint(context, phase);
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: Merge this loop with the above somehow..
|
||||
if (phase == PaintPhase::FocusOutline) {
|
||||
for (auto& line_box : m_line_boxes) {
|
||||
for (auto& fragment : line_box.fragments()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue