SVGGeometryBox.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  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/SVGGeometryElement.h>
  9. namespace Web::Layout {
  10. class SVGGeometryBox final : public SVGGraphicsBox {
  11. public:
  12. SVGGeometryBox(DOM::Document&, SVG::SVGGeometryElement&, NonnullRefPtr<CSS::StyleProperties>);
  13. virtual ~SVGGeometryBox() override = default;
  14. SVG::SVGGeometryElement& dom_node() { return verify_cast<SVG::SVGGeometryElement>(SVGGraphicsBox::dom_node()); }
  15. SVG::SVGGeometryElement const& dom_node() const { return verify_cast<SVG::SVGGeometryElement>(SVGGraphicsBox::dom_node()); }
  16. float viewbox_scaling() const;
  17. Gfx::FloatPoint viewbox_origin() const;
  18. virtual RefPtr<Painting::Paintable> create_paintable() const override;
  19. private:
  20. virtual bool is_svg_geometry_box() const final { return true; }
  21. };
  22. template<>
  23. inline bool Node::fast_is<SVGGeometryBox>() const { return is_svg_geometry_box(); }
  24. }