summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/SVG/SVGPathElement.h
blob: 6596a8a8b8494390dbdec35c9c312d808ee2360f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
 * Copyright (c) 2020, Matthew Olsson <mattco@serenityos.org>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <LibGfx/Bitmap.h>
#include <LibWeb/HTML/HTMLElement.h>
#include <LibWeb/SVG/AttributeParser.h>
#include <LibWeb/SVG/SVGGeometryElement.h>

namespace Web::SVG {

class SVGPathElement final : public SVGGeometryElement {
    WEB_PLATFORM_OBJECT(SVGPathElement, SVGGeometryElement);

public:
    virtual ~SVGPathElement() override = default;

    virtual void parse_attribute(FlyString const& name, String const& value) override;

    virtual Gfx::Path& get_path() override;

private:
    SVGPathElement(DOM::Document&, DOM::QualifiedName);

    Vector<PathInstruction> m_instructions;
    Gfx::FloatPoint m_previous_control_point = {};
    Optional<Gfx::Path> m_path;
};

}