From dee825e50365b72c730e2ba60c976326e967d805 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 2 Jan 2025 17:06:02 +0100 Subject: [PATCH] Fixed images displaying the initial texture when the texture callback starts returning null --- CHANGELOG.md | 1 + MLEM.Ui/Elements/Image.cs | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac84dbe..923cd59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ Fixes - Fixed a stack overflow exception when a panel's children have just enough height to cause a scroll bar to appear - Fixed AddedToUi and RemovedFromUi being called for freshly added or removed children whose parents are not in a ui system - Fixed UiParser ImageExceptionHandler being ignored when an exception occurs during texture construction +- Fixed images displaying the initial texture when the texture callback starts returning null ### MLEM.Data Improvements diff --git a/MLEM.Ui/Elements/Image.cs b/MLEM.Ui/Elements/Image.cs index 59fcf34..033f1e5 100644 --- a/MLEM.Ui/Elements/Image.cs +++ b/MLEM.Ui/Elements/Image.cs @@ -125,7 +125,6 @@ namespace MLEM.Ui.Elements { /// public Image(Anchor anchor, Vector2 size, TextureCallback getTextureCallback, bool scaleToImage = false) : base(anchor, size) { this.GetTextureCallback = getTextureCallback; - this.Texture = getTextureCallback(this); this.ScaleToImage = scaleToImage; this.CanBeSelected = false; this.CanBeMoused = false;