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