LineBoxFragment.cpp 537 B

1234567891011121314151617
  1. #include <LibGUI/GPainter.h>
  2. #include <LibHTML/Layout/LayoutText.h>
  3. #include <LibHTML/Layout/LineBoxFragment.h>
  4. #include <LibHTML/RenderingContext.h>
  5. void LineBoxFragment::render(RenderingContext& context)
  6. {
  7. for (auto* ancestor = layout_node().parent(); ancestor; ancestor = ancestor->parent()) {
  8. if (!ancestor->is_visible())
  9. return;
  10. }
  11. if (layout_node().is_text()) {
  12. auto& layout_text = static_cast<const LayoutText&>(layout_node());
  13. layout_text.render_fragment(context, *this);
  14. }
  15. }