1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-23 18:25:08 +00:00

LibHTML+Browser: Add debug option to draw borders around line boxes

This will be very useful when debugging line layout.
This commit is contained in:
Andreas Kling 2019-10-12 15:02:53 +02:00
parent 14f0a5943b
commit 2530378f59
5 changed files with 20 additions and 0 deletions

View file

@ -204,6 +204,8 @@ void LayoutBlock::render(RenderingContext& context)
if (children_are_inline()) {
for (auto& line_box : m_line_boxes) {
for (auto& fragment : line_box.fragments()) {
if (context.should_show_line_box_borders())
context.painter().draw_rect(fragment.rect(), Color::Green);
fragment.render(context);
}
}