diff options
| author | Yuqian Yang <crupest@crupest.life> | 2025-09-21 23:40:30 +0800 |
|---|---|---|
| committer | Yuqian Yang <crupest@crupest.life> | 2025-12-18 17:29:36 +0800 |
| commit | b89a4783e033db1530322a35a1674630c413e847 (patch) | |
| tree | 20d297c70c0047e65a707f41bfbc96318e1bcb1f /src/platform/graphics/quartz/Geometry.cpp | |
| parent | 6bbadfc6b1eaf14f68a27cb8e378f5e09ab38de6 (diff) | |
| download | cru-b89a4783e033db1530322a35a1674630c413e847.tar.gz cru-b89a4783e033db1530322a35a1674630c413e847.tar.bz2 cru-b89a4783e033db1530322a35a1674630c413e847.zip | |
HALF WORK!
Diffstat (limited to 'src/platform/graphics/quartz/Geometry.cpp')
| -rw-r--r-- | src/platform/graphics/quartz/Geometry.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/platform/graphics/quartz/Geometry.cpp b/src/platform/graphics/quartz/Geometry.cpp index 4c2f90a6..9b93ce15 100644 --- a/src/platform/graphics/quartz/Geometry.cpp +++ b/src/platform/graphics/quartz/Geometry.cpp @@ -67,6 +67,20 @@ void QuartzGeometryBuilder::QuadraticBezierTo(const Point &control_point, control_point.y, end_point.x, end_point.y); } +void QuartzGeometryBuilder::ArcTo(const Point &radius, float angle, + bool is_large_arc, bool is_clockwise, + const Point &end_point) { + auto info = CalculateArcInfo(GetCurrentPosition(), radius, angle, + is_large_arc, is_clockwise, end_point); + + auto matrix = + Matrix::Translation(info.center) * Matrix::Scale(radius.x, radius.y); + CGAffineTransform transform = Convert(matrix); + + CGPathAddArc(cg_mutable_path_, &transform, 0, 0, 1, info.start_angle, + info.end_angle, true); +} + void QuartzGeometryBuilder::CloseFigure(bool close) { if (close) CGPathCloseSubpath(cg_mutable_path_); } |
