1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Component: Use Context appropriate ImageType for temporary images

Co-authored-by: Matt Gonzalez <matt@echoaudio.com>
This commit is contained in:
Oli 2025-04-15 13:37:50 +01:00
parent 250abe9cf4
commit 4ba01a80a0
3 changed files with 16 additions and 6 deletions

View file

@ -50,11 +50,13 @@ struct StandardCachedComponentImage : public CachedComponentImage
if (image.isNull() || image.getBounds() != imageBounds)
{
auto tempImageType = g.getInternalContext().getPreferredImageTypeForTemporaryImages();
image = Image (owner.isOpaque() ? Image::RGB
: Image::ARGB,
jmax (1, imageBounds.getWidth()),
jmax (1, imageBounds.getHeight()),
! owner.isOpaque());
! owner.isOpaque(),
*tempImageType);
image.setBackupEnabled (false);
validArea.clear();
}