SVGPathBox.h 782 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Copyright (c) 2020, Matthew Olsson <mattco@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/Layout/SVGGraphicsBox.h>
  8. #include <LibWeb/SVG/SVGPathElement.h>
  9. namespace Web::Layout {
  10. class SVGPathBox final : public SVGGraphicsBox {
  11. public:
  12. SVGPathBox(DOM::Document&, SVG::SVGPathElement&, NonnullRefPtr<CSS::StyleProperties>);
  13. virtual ~SVGPathBox() override = default;
  14. SVG::SVGPathElement& dom_node() { return verify_cast<SVG::SVGPathElement>(SVGGraphicsBox::dom_node()); }
  15. virtual void paint(PaintContext& context, PaintPhase phase) override;
  16. private:
  17. virtual bool is_svg_path_box() const final { return true; }
  18. };
  19. template<>
  20. inline bool Node::fast_is<SVGPathBox>() const { return is_svg_path_box(); }
  21. }