2020-10-05 16:14:36 -07:00
|
|
|
/*
|
2021-04-22 16:53:07 -07:00
|
|
|
* Copyright (c) 2020, Matthew Olsson <mattco@serenityos.org>
|
2020-10-05 16:14:36 -07:00
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-10-05 16:14:36 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2020-11-22 15:53:01 +01:00
|
|
|
#include <LibWeb/Layout/SVGGraphicsBox.h>
|
2022-02-11 12:32:55 +00:00
|
|
|
#include <LibWeb/SVG/SVGGeometryElement.h>
|
2020-10-05 16:14:36 -07:00
|
|
|
|
2020-11-22 15:53:01 +01:00
|
|
|
namespace Web::Layout {
|
2020-10-05 16:14:36 -07:00
|
|
|
|
2022-02-11 12:37:22 +00:00
|
|
|
class SVGGeometryBox final : public SVGGraphicsBox {
|
2020-10-05 16:14:36 -07:00
|
|
|
public:
|
2022-02-11 12:37:22 +00:00
|
|
|
SVGGeometryBox(DOM::Document&, SVG::SVGGeometryElement&, NonnullRefPtr<CSS::StyleProperties>);
|
|
|
|
|
virtual ~SVGGeometryBox() override = default;
|
2020-10-05 16:14:36 -07:00
|
|
|
|
2022-02-11 12:32:55 +00:00
|
|
|
SVG::SVGGeometryElement& dom_node() { return verify_cast<SVG::SVGGeometryElement>(SVGGraphicsBox::dom_node()); }
|
|
|
|
|
SVG::SVGGeometryElement const& dom_node() const { return verify_cast<SVG::SVGGeometryElement>(SVGGraphicsBox::dom_node()); }
|
2020-10-05 16:14:36 -07:00
|
|
|
|
2022-02-27 21:00:04 +01:00
|
|
|
float viewbox_scaling() const;
|
|
|
|
|
Gfx::FloatPoint viewbox_origin() const;
|
|
|
|
|
|
2022-03-10 22:38:08 +01:00
|
|
|
virtual RefPtr<Painting::Paintable> create_paintable() const override;
|
|
|
|
|
|
2021-10-18 16:26:05 +02:00
|
|
|
private:
|
2022-02-11 12:37:22 +00:00
|
|
|
virtual bool is_svg_geometry_box() const final { return true; }
|
2020-10-05 16:14:36 -07:00
|
|
|
};
|
|
|
|
|
|
2021-10-18 16:26:05 +02:00
|
|
|
template<>
|
2022-02-11 12:37:22 +00:00
|
|
|
inline bool Node::fast_is<SVGGeometryBox>() const { return is_svg_geometry_box(); }
|
2021-10-18 16:26:05 +02:00
|
|
|
|
2020-10-05 16:14:36 -07:00
|
|
|
}
|