Fixed an issue where the cached background would sometimes miss some GUI elements.

This commit is contained in:
Leon Styhre 2022-01-09 19:50:11 +01:00
parent f66bb91496
commit 5c07e29101

View file

@ -11,6 +11,7 @@
#include "Log.h" #include "Log.h"
#include "Settings.h" #include "Settings.h"
#include "ThemeData.h" #include "ThemeData.h"
#include "Window.h"
#include "resources/TextureResource.h" #include "resources/TextureResource.h"
#include "utils/CImgUtil.h" #include "utils/CImgUtil.h"
@ -402,8 +403,14 @@ void ImageComponent::render(const glm::mat4& parentTrans)
// Actually draw the image. // Actually draw the image.
// The bind() function returns false if the texture is not currently loaded. A blank // The bind() function returns false if the texture is not currently loaded. A blank
// texture is bound in this case but we want to handle a fade so it doesn't just // texture is bound in this case but we want to handle a fade so it doesn't just
// 'jump' in when it finally loads. // 'jump' in when it finally loads. The exception is if the cached background is
// getting invalidated, in which case we want to make sure to not get a partially
// faded texture rendered onto the new background.
if (mWindow->isInvalidatingCachedBackground())
mTexture->bind();
else
fadeIn(mTexture->bind()); fadeIn(mTexture->bind());
#if defined(USE_OPENGL_21) #if defined(USE_OPENGL_21)
if (mSaturation < 1.0) { if (mSaturation < 1.0) {
mVertices[0].shaders = Renderer::SHADER_DESATURATE; mVertices[0].shaders = Renderer::SHADER_DESATURATE;