Browse Source

Fixed a bug on OSX where images with SingleChannel PixelFormat were being created with an RGB colour space

tags/2021-05-28
ed 8 years ago
parent
commit
a6d3c971fc
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm

+ 2
- 1
modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm View File

@@ -478,7 +478,8 @@ void CoreGraphicsContext::drawImage (const Image& sourceImage, const AffineTrans
{
const int iw = sourceImage.getWidth();
const int ih = sourceImage.getHeight();
CGImageRef image = CoreGraphicsImage::getCachedImageRef (sourceImage, rgbColourSpace);
CGImageRef image = CoreGraphicsImage::getCachedImageRef (sourceImage, sourceImage.getFormat() == Image::PixelFormat::SingleChannel ? greyColourSpace
: rgbColourSpace);
CGContextSaveGState (context);
CGContextSetAlpha (context, state->fillType.getOpacity());


Loading…
Cancel
Save