ladybird/Userland/Libraries/LibWeb/SVG/SVGCircleElement.h
MacDue 74b655d035 LibWeb: Update SVG <circle> element to use geometry properties
With this the `<circle>` element now correctly parses percentage sizes,
and resolves them relative to the viewport.

The rest of the geometry elements are still left TODO.
2024-03-04 10:50:32 +01:00

36 lines
896 B
C++

/*
* Copyright (c) 2022, Sam Atkins <atkinssj@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/SVG/SVGAnimatedLength.h>
#include <LibWeb/SVG/SVGGeometryElement.h>
namespace Web::SVG {
class SVGCircleElement final : public SVGGeometryElement {
WEB_PLATFORM_OBJECT(SVGCircleElement, SVGGeometryElement);
JS_DECLARE_ALLOCATOR(SVGCircleElement);
public:
virtual ~SVGCircleElement() override = default;
virtual void apply_presentational_hints(CSS::StyleProperties&) const override;
virtual Gfx::Path get_path(CSSPixelSize viewport_size) override;
JS::NonnullGCPtr<SVGAnimatedLength> cx() const;
JS::NonnullGCPtr<SVGAnimatedLength> cy() const;
JS::NonnullGCPtr<SVGAnimatedLength> r() const;
private:
SVGCircleElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
};
}