mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-23 17:52:26 -05:00
809c15d1ee
This is needed for hit testing the directional arrows on the Street View office tour, and generally makes SVG hit testing more precise. Note: The rough bounding box is hit test first, so this should not be a load more overhead.
30 lines
753 B
C++
30 lines
753 B
C++
/*
|
|
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibWeb/Layout/SVGGeometryBox.h>
|
|
#include <LibWeb/Painting/SVGGraphicsPaintable.h>
|
|
|
|
namespace Web::Painting {
|
|
|
|
class SVGGeometryPaintable final : public SVGGraphicsPaintable {
|
|
JS_CELL(SVGGeometryPaintable, SVGGraphicsPaintable);
|
|
|
|
public:
|
|
static JS::NonnullGCPtr<SVGGeometryPaintable> create(Layout::SVGGeometryBox const&);
|
|
|
|
virtual Optional<HitTestResult> hit_test(CSSPixelPoint, HitTestType) const override;
|
|
|
|
virtual void paint(PaintContext&, PaintPhase) const override;
|
|
|
|
Layout::SVGGeometryBox const& layout_box() const;
|
|
|
|
protected:
|
|
SVGGeometryPaintable(Layout::SVGGeometryBox const&);
|
|
};
|
|
|
|
}
|