Files
UnrealEngine/Engine/Source/Editor/UnrealEd/Private/ThumbnailRendering/Texture2DArrayThumbnailRenderer.cpp
2025-05-18 13:04:45 +08:00

34 lines
1.1 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "Factories/Texture2dArrayThumbnailRenderer.h"
#include "Engine/Texture2DArray.h"
#include "ThumbnailRendering/ThumbnailManager.h"
UTexture2DArrayThumbnailRenderer::UTexture2DArrayThumbnailRenderer(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
}
void UTexture2DArrayThumbnailRenderer::GetThumbnailSize(UObject* Object, float Zoom, uint32& OutWidth, uint32& OutHeight) const
{
OutWidth = 0;
OutHeight = 0;
UTexture2DArray* TextureArray = Cast<UTexture2DArray>(Object);
if (TextureArray != nullptr)
{
// Let the base class get the size of a face
Super::GetThumbnailSize(TextureArray, Zoom, OutWidth, OutHeight);
}
}
void UTexture2DArrayThumbnailRenderer::Draw(UObject* Object, int32 X, int32 Y, uint32 Width, uint32 Height, FRenderTarget*, FCanvas* Canvas, bool bAdditionalViewFamily)
{
UTexture2DArray* TextureArray = Cast<UTexture2DArray>(Object);
if (TextureArray != nullptr)
{
Super::Draw(TextureArray, X, Y, Width, Height, nullptr, Canvas, bAdditionalViewFamily);
}
}