SVGPathElement.h 803 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 2020, Matthew Olsson <mattco@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibGfx/Bitmap.h>
  8. #include <LibWeb/HTML/HTMLElement.h>
  9. #include <LibWeb/SVG/AttributeParser.h>
  10. #include <LibWeb/SVG/SVGGeometryElement.h>
  11. namespace Web::SVG {
  12. class SVGPathElement final : public SVGGeometryElement {
  13. public:
  14. using WrapperType = Bindings::SVGPathElementWrapper;
  15. SVGPathElement(DOM::Document&, DOM::QualifiedName);
  16. virtual ~SVGPathElement() override = default;
  17. virtual void parse_attribute(const FlyString& name, const String& value) override;
  18. virtual Gfx::Path& get_path() override;
  19. private:
  20. Vector<PathInstruction> m_instructions;
  21. Gfx::FloatPoint m_previous_control_point = {};
  22. Optional<Gfx::Path> m_path;
  23. };
  24. }