diff options
author | crupest <crupest@outlook.com> | 2021-08-21 23:15:43 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-08-21 23:15:43 +0800 |
commit | c0616e3892e4f713bea7abd217191b8713a1d1bf (patch) | |
tree | fd1baef5d9752b36a065a2e9677b46676f60c0f9 /src/osx/graphics/quartz/Painter.cpp | |
parent | e2e8ba559b0e7a797c083684b382ac4cbb2fdd5f (diff) | |
download | cru-c0616e3892e4f713bea7abd217191b8713a1d1bf.tar.gz cru-c0616e3892e4f713bea7abd217191b8713a1d1bf.tar.bz2 cru-c0616e3892e4f713bea7abd217191b8713a1d1bf.zip |
...
Diffstat (limited to 'src/osx/graphics/quartz/Painter.cpp')
-rw-r--r-- | src/osx/graphics/quartz/Painter.cpp | 15 |
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)); + } +} |