1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 18:05:07 +00:00
serenity/Userland/Libraries/LibWeb/SVG/SVGGeometryElement.cpp
Sam Atkins 326a5a82eb LibWeb: Move SVGPathElement methods into SVGGeometryElement
From the spec:

> Interface SVGGeometryElement represents SVG elements whose rendering
> is defined by geometry with an equivalent path, and which can be
> filled and stroked. This includes paths and the basic shapes.

- https://svgwg.org/svg2-draft/types.html#InterfaceSVGGeometryElement

Making them all create an SVGPathBox, and return a Path from get_path(),
means we can implement the "basic shapes" using the path system we
already have. :^)
2022-02-11 21:38:27 +01:00

22 lines
563 B
C++

/*
* Copyright (c) 2020, Matthew Olsson <mattco@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/Layout/SVGPathBox.h>
#include <LibWeb/SVG/SVGGeometryElement.h>
namespace Web::SVG {
SVGGeometryElement::SVGGeometryElement(DOM::Document& document, QualifiedName qualified_name)
: SVGGraphicsElement(document, move(qualified_name))
{
}
RefPtr<Layout::Node> SVGGeometryElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
{
return adopt_ref(*new Layout::SVGPathBox(document(), *this, move(style)));
}
}