2022-02-11 19:56:36 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2022, Sam Atkins <atkinssj@serenityos.org>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2022-03-22 19:31:52 +03:00
|
|
|
#include <LibWeb/SVG/SVGAnimatedLength.h>
|
2022-02-11 19:56:36 +03:00
|
|
|
#include <LibWeb/SVG/SVGGeometryElement.h>
|
|
|
|
|
|
|
|
namespace Web::SVG {
|
|
|
|
|
|
|
|
class SVGLineElement final : public SVGGeometryElement {
|
2023-01-10 05:51:45 +03:00
|
|
|
WEB_PLATFORM_OBJECT(SVGLineElement, SVGGeometryElement);
|
2023-11-19 21:47:52 +03:00
|
|
|
JS_DECLARE_ALLOCATOR(SVGLineElement);
|
2022-02-11 19:56:36 +03:00
|
|
|
|
2022-08-28 14:42:07 +03:00
|
|
|
public:
|
2022-02-11 19:56:36 +03:00
|
|
|
virtual ~SVGLineElement() override = default;
|
|
|
|
|
2023-11-19 08:10:36 +03:00
|
|
|
virtual void attribute_changed(FlyString const& name, Optional<String> const& value) override;
|
2022-02-11 19:56:36 +03:00
|
|
|
|
2024-03-03 23:15:06 +03:00
|
|
|
virtual Gfx::Path get_path(CSSPixelSize viewport_size) override;
|
2022-02-11 19:56:36 +03:00
|
|
|
|
2022-09-02 15:04:59 +03:00
|
|
|
JS::NonnullGCPtr<SVGAnimatedLength> x1() const;
|
|
|
|
JS::NonnullGCPtr<SVGAnimatedLength> y1() const;
|
|
|
|
JS::NonnullGCPtr<SVGAnimatedLength> x2() const;
|
|
|
|
JS::NonnullGCPtr<SVGAnimatedLength> y2() const;
|
2022-03-22 19:31:52 +03:00
|
|
|
|
2022-02-11 19:56:36 +03:00
|
|
|
private:
|
2022-08-28 14:42:07 +03:00
|
|
|
SVGLineElement(DOM::Document&, DOM::QualifiedName);
|
|
|
|
|
2023-08-07 09:41:28 +03:00
|
|
|
virtual void initialize(JS::Realm&) override;
|
2023-01-10 14:28:20 +03:00
|
|
|
|
2022-02-11 19:56:36 +03:00
|
|
|
Optional<float> m_x1;
|
|
|
|
Optional<float> m_y1;
|
|
|
|
Optional<float> m_x2;
|
|
|
|
Optional<float> m_y2;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|