diff options
author | crupest <crupest@outlook.com> | 2022-02-28 23:21:01 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-02-28 23:21:01 +0800 |
commit | a310733b429a99aff14d840f6de663a685917d00 (patch) | |
tree | b2457142a4df70589dc036061ff7dc005750b62b /include/cru/platform/graphics | |
parent | 5b891e26f0510d8bd62c01a9e03ca677341cf74f (diff) | |
download | cru-a310733b429a99aff14d840f6de663a685917d00.tar.gz cru-a310733b429a99aff14d840f6de663a685917d00.tar.bz2 cru-a310733b429a99aff14d840f6de663a685917d00.zip |
...
Diffstat (limited to 'include/cru/platform/graphics')
-rw-r--r-- | include/cru/platform/graphics/Geometry.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/cru/platform/graphics/Geometry.h b/include/cru/platform/graphics/Geometry.h index 1a303742..a4146008 100644 --- a/include/cru/platform/graphics/Geometry.h +++ b/include/cru/platform/graphics/Geometry.h @@ -6,8 +6,6 @@ struct CRU_PLATFORM_GRAPHICS_API IGeometry : virtual IGraphicsResource { virtual bool FillContains(const Point& point) = 0; }; -// After called Build, calling every method will throw a - struct CRU_PLATFORM_GRAPHICS_API IGeometryBuilder : virtual IGraphicsResource { virtual Point GetCurrentPosition() = 0; @@ -17,9 +15,11 @@ struct CRU_PLATFORM_GRAPHICS_API IGeometryBuilder : virtual IGraphicsResource { } virtual void LineTo(const Point& point) = 0; + void LineTo(float x, float y) { LineTo(Point(x, y)); } void RelativeLineTo(const Point& offset) { LineTo(GetCurrentPosition() + offset); } + void RelativeLineTo(float x, float y) { RelativeLineTo(Point(x, y)); } virtual void CubicBezierTo(const Point& start_control_point, const Point& end_control_point, @@ -53,5 +53,7 @@ struct CRU_PLATFORM_GRAPHICS_API IGeometryBuilder : virtual IGraphicsResource { virtual void CloseFigure(bool close) = 0; virtual std::unique_ptr<IGeometry> Build() = 0; + + void ParseAndApplySvgPathData(StringView path_d); }; } // namespace cru::platform::graphics |