diff --git a/SDWebImageSVGNativeCoder/Classes/SDImageSVGNativeCoder.mm b/SDWebImageSVGNativeCoder/Classes/SDImageSVGNativeCoder.mm index 38071c8..6e114b3 100644 --- a/SDWebImageSVGNativeCoder/Classes/SDImageSVGNativeCoder.mm +++ b/SDWebImageSVGNativeCoder/Classes/SDImageSVGNativeCoder.mm @@ -80,6 +80,13 @@ - (nullable UIImage *)decodedImageWithData:(nullable NSData *)data options:(null renderer->SetGraphicsContext(ctx); +#if SD_MAC + // Core Graphics Coordinate System convert. SDWebImage use's non-flipped one + // See: [NSGraphicsContext graphicsContextWithCGContext:context flipped:NO]; + CGContextScaleCTM(ctx, 1, -1); + CGContextTranslateCTM(ctx, 0, -svgSize.height); +#endif + doc->Render(svgSize.width, svgSize.height); renderer->ReleaseGraphicsContext();