Fix the sd_rotatedImageWithAngle on macOS, which should not apply the counterclockwise reverse
This commit is contained in:
parent
3929f2cd2a
commit
92e3bfcc3e
|
@ -269,9 +269,13 @@ static inline UIColor * SDGetColorFromPixel(Pixel_8888 pixel, CGBitmapInfo bitma
|
||||||
CGContextSetShouldAntialias(context, true);
|
CGContextSetShouldAntialias(context, true);
|
||||||
CGContextSetAllowsAntialiasing(context, true);
|
CGContextSetAllowsAntialiasing(context, true);
|
||||||
CGContextSetInterpolationQuality(context, kCGInterpolationHigh);
|
CGContextSetInterpolationQuality(context, kCGInterpolationHigh);
|
||||||
// Use UIKit coordinate counterclockwise (⟲)
|
|
||||||
CGContextTranslateCTM(context, +(newRect.size.width * 0.5), +(newRect.size.height * 0.5));
|
CGContextTranslateCTM(context, +(newRect.size.width * 0.5), +(newRect.size.height * 0.5));
|
||||||
|
#if SD_UIKIT
|
||||||
|
// Use UIKit coordinate system counterclockwise (⟲)
|
||||||
CGContextRotateCTM(context, -angle);
|
CGContextRotateCTM(context, -angle);
|
||||||
|
#else
|
||||||
|
CGContextRotateCTM(context, angle);
|
||||||
|
#endif
|
||||||
|
|
||||||
[self drawInRect:CGRectMake(-(width * 0.5), -(height * 0.5), width, height)];
|
[self drawInRect:CGRectMake(-(width * 0.5), -(height * 0.5), width, height)];
|
||||||
}];
|
}];
|
||||||
|
|
Loading…
Reference in New Issue