Fixed an issue where corrupt textures could get rendered.

This commit is contained in:
Leon Styhre 2022-02-01 17:51:00 +01:00
parent 17d8f8eb5b
commit 36fe3c871c
2 changed files with 3 additions and 2 deletions

View file

@ -384,8 +384,8 @@ void ImageComponent::updateColors()
void ImageComponent::render(const glm::mat4& parentTrans)
{
if (!isVisible() || mTexture == nullptr ||
(mTargetSize == glm::vec2 {0.0f, 0.0f} && mSize == glm::vec2 {0.0f, 0.0f}))
if (!isVisible() || mTexture == nullptr || mTargetSize == glm::vec2 {0.0f, 0.0f} ||
mSize == glm::vec2 {0.0f, 0.0f})
return;
glm::mat4 trans {parentTrans * getTransform()};

View file

@ -485,6 +485,7 @@ void TextListComponent<T>::applyTheme(const std::shared_ptr<ThemeData>& theme,
bool tile = elem->has("selectorImageTile") && elem->get<bool>("selectorImageTile");
mSelectorImage.setImage(path, tile);
mSelectorImage.setSize(mSize.x, mSelectorHeight);
mSelectorImage.setResize(mSize.x, mSelectorHeight);
mSelectorImage.setColorShift(mSelectorColor);
mSelectorImage.setColorShiftEnd(mSelectorColorEnd);
}