aboutsummaryrefslogtreecommitdiff
path: root/src/osx
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-02-01 18:53:35 +0800
committercrupest <crupest@outlook.com>2022-02-01 18:53:35 +0800
commit4a8192bf6b614708d8729cb3a87f938860c229b2 (patch)
tree016e80c7d04b486bea81decc7dce50e928d58591 /src/osx
parentd1c14725443399f7145e314d79597ec35b639eeb (diff)
downloadcru-4a8192bf6b614708d8729cb3a87f938860c229b2.tar.gz
cru-4a8192bf6b614708d8729cb3a87f938860c229b2.tar.bz2
cru-4a8192bf6b614708d8729cb3a87f938860c229b2.zip
...
Diffstat (limited to 'src/osx')
-rw-r--r--src/osx/graphics/quartz/Painter.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/osx/graphics/quartz/Painter.cpp b/src/osx/graphics/quartz/Painter.cpp
index 3c39ec61..173cf47a 100644
--- a/src/osx/graphics/quartz/Painter.cpp
+++ b/src/osx/graphics/quartz/Painter.cpp
@@ -174,10 +174,17 @@ void QuartzCGContextPainter::DrawText(const Point& offset,
CGContextRestoreGState(cg_context_);
}
-void QuartzCGContextPainter::DrawImage(const Rect& rect, IImage* image) {
+void QuartzCGContextPainter::DrawImage(const Point& offset, IImage* image) {
Validate();
auto i = CheckPlatform<QuartzImage>(image, GetPlatformId());
- CGContextDrawImage(cg_context_, Convert(rect), i->GetCGImage());
+
+ auto cg_image = i->GetCGImage();
+
+ auto width = CGImageGetWidth(cg_image);
+ auto height = CGImageGetHeight(cg_image);
+
+ CGContextDrawImage(cg_context_, CGRectMake(offset.x, offset.y, width, height),
+ cg_image);
}
void QuartzCGContextPainter::PushLayer(const Rect& bounds) {