LineBoxFragment.cpp 486 B

12345678910111213141516
  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 (is<LayoutText>(layout_node())) {
  12. to<LayoutText>(layout_node()).render_fragment(context, *this);
  13. }
  14. }