aboutsummaryrefslogtreecommitdiff
path: root/src/osx/graphics/quartz/Painter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/osx/graphics/quartz/Painter.cpp')
-rw-r--r--src/osx/graphics/quartz/Painter.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/osx/graphics/quartz/Painter.cpp b/src/osx/graphics/quartz/Painter.cpp
index b3006a97..65cf9154 100644
--- a/src/osx/graphics/quartz/Painter.cpp
+++ b/src/osx/graphics/quartz/Painter.cpp
@@ -1 +1,16 @@
#include "cru/osx/graphics/quartz/Painter.hpp"
+
+#include "cru/osx/graphics/quartz/Convert.hpp"
+
+namespace cru::platform::graphics::osx::quartz {
+ Matrix QuartzCGContextPainter::GetTransform() {
+ return Convert(CGContextGetCTM(cg_context_));
+ }
+
+ void QuartzCGContextPainter::SetTransform(const Matrix& matrix) {
+ auto old = CGContextGetCTM(cg_context_);
+ old = CGAffineTransformInvert(old);
+ CGContextConcatCTM(cg_context_, old);
+ CGContextConcatCTM(cg_context_, Convert(matrix));
+ }
+}