diff options
author | crupest <crupest@outlook.com> | 2022-05-25 16:01:23 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-05-25 16:01:23 +0800 |
commit | b84cd6a0b6fc3e7f9493d50ce32cfb33095e7954 (patch) | |
tree | 3cde83841ca20375e96ad036aefbf2a02990e971 /include/cru/platform/graphics | |
parent | ad4f06c133dc0475ef6a98cac0fa97f6e0527bf1 (diff) | |
download | cru-b84cd6a0b6fc3e7f9493d50ce32cfb33095e7954.tar.gz cru-b84cd6a0b6fc3e7f9493d50ce32cfb33095e7954.tar.bz2 cru-b84cd6a0b6fc3e7f9493d50ce32cfb33095e7954.zip |
...
Diffstat (limited to 'include/cru/platform/graphics')
-rw-r--r-- | include/cru/platform/graphics/Geometry.h | 6 | ||||
-rw-r--r-- | include/cru/platform/graphics/cairo/CairoGeometry.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/include/cru/platform/graphics/Geometry.h b/include/cru/platform/graphics/Geometry.h index 19620789..d1045b59 100644 --- a/include/cru/platform/graphics/Geometry.h +++ b/include/cru/platform/graphics/Geometry.h @@ -5,6 +5,12 @@ namespace cru::platform::graphics { struct CRU_PLATFORM_GRAPHICS_API IGeometry : virtual IGraphicsResource { + /** + * \remarks Because I designed CreateStrokeGeometry first, which might be not + * that rational. So the default implementation calls that method and do the + * test. New implementation should override this. + */ + virtual bool StrokeContains(float width, const Point& point); virtual bool FillContains(const Point& point) = 0; virtual Rect GetBounds() = 0; virtual std::unique_ptr<IGeometry> Transform(const Matrix& matrix) = 0; diff --git a/include/cru/platform/graphics/cairo/CairoGeometry.h b/include/cru/platform/graphics/cairo/CairoGeometry.h index f8391670..f510d687 100644 --- a/include/cru/platform/graphics/cairo/CairoGeometry.h +++ b/include/cru/platform/graphics/cairo/CairoGeometry.h @@ -13,6 +13,7 @@ class CRU_PLATFORM_GRAPHICS_CAIRO_API CairoGeometry : public CairoResource, bool auto_destroy = true); ~CairoGeometry(); + bool StrokeContains(float width, const Point& point) override; bool FillContains(const Point& point) override; Rect GetBounds() override; std::unique_ptr<IGeometry> Transform(const Matrix& matrix) override; |