From 4a8192bf6b614708d8729cb3a87f938860c229b2 Mon Sep 17 00:00:00 2001 From: crupest Date: Tue, 1 Feb 2022 18:53:35 +0800 Subject: ... --- src/osx/graphics/quartz/Painter.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/osx') 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(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) { -- cgit v1.2.3