Update UiCustomImageComponent to use Atom (#6628)

Signed-off-by: abrmich <abrmich@amazon.com>
This commit is contained in:
michabr
2022-01-04 18:13:44 -08:00
committed by GitHub
parent b719b1e8ee
commit 5eb6c2d24b
2 changed files with 12 additions and 30 deletions
@@ -353,7 +353,6 @@ void UiImageComponent::SetOverrideSprite(ISprite* sprite, AZ::u32 cellIndex)
////////////////////////////////////////////////////////////////////////////////////////////////////
void UiImageComponent::Render(LyShine::IRenderGraph* renderGraph)
{
// get fade value (tracked by UiRenderer) and compute the desired alpha for the image
float fade = renderGraph->GetAlphaFade();
float desiredAlpha = m_overrideAlpha * fade;
@@ -376,9 +375,8 @@ void UiImageComponent::Render(LyShine::IRenderGraph* renderGraph)
ImageType imageType = m_imageType;
#ifdef LYSHINE_ATOM_TODO // support default white texture
// if there is no texture we will just use a white texture and want to stretch it
const bool spriteOrTextureIsNull = sprite == nullptr || sprite->GetTexture() == nullptr;
const bool spriteOrTextureIsNull = sprite == nullptr || sprite->GetImage() == nullptr;
// Zero texture size may occur even if the UiImageComponent has a valid non-zero-sized texture,
// because a canvas can be requested to Render() before the texture asset is done loading.
@@ -399,12 +397,6 @@ void UiImageComponent::Render(LyShine::IRenderGraph* renderGraph)
{
imageType = ImageType::Stretched;
}
#else
if (sprite == nullptr)
{
imageType = ImageType::Stretched;
}
#endif
switch (imageType)
{