LineBoxFragment.h 748 B

1234567891011121314151617181920212223242526272829303132
  1. #pragma once
  2. #include <LibDraw/Rect.h>
  3. class LayoutNode;
  4. class RenderingContext;
  5. class LineBoxFragment {
  6. friend class LineBox;
  7. public:
  8. LineBoxFragment(const LayoutNode& layout_node, int start, int length, const Rect& rect)
  9. : m_layout_node(layout_node)
  10. , m_start(start)
  11. , m_length(length)
  12. , m_rect(rect)
  13. {
  14. }
  15. const LayoutNode& layout_node() const { return m_layout_node; }
  16. int start() const { return m_start; }
  17. int length() const { return m_length; }
  18. const Rect& rect() const { return m_rect; }
  19. Rect& rect() { return m_rect; }
  20. void render(RenderingContext&);
  21. private:
  22. const LayoutNode& m_layout_node;
  23. int m_start { 0 };
  24. int m_length { 0 };
  25. Rect m_rect;
  26. };