From 7d9633d989d00e364a66497d04704ca1a4f05731 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Tue, 7 Jun 2022 11:57:25 +0200 Subject: [PATCH] Fixed StaticSpriteBatch not resetting its texture when all items are removed --- CHANGELOG.md | 3 +++ MLEM/Graphics/StaticSpriteBatch.cs | 2 ++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d8dcf4..a42aa18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,9 @@ Additions Improvements - Allow comparing Keybind and Combination based on the amount of modifiers they have +Fixes +- Fixed StaticSpriteBatch not resetting its texture when all items are removed + ### MLEM.Ui Additions - Added Element.AutoNavGroup which allows forming groups for auto-navigation diff --git a/MLEM/Graphics/StaticSpriteBatch.cs b/MLEM/Graphics/StaticSpriteBatch.cs index ebfc824..933d71f 100644 --- a/MLEM/Graphics/StaticSpriteBatch.cs +++ b/MLEM/Graphics/StaticSpriteBatch.cs @@ -337,6 +337,8 @@ namespace MLEM.Graphics { if (!this.batching) throw new InvalidOperationException("Not batching"); if (this.items.Remove(item)) { + if (this.items.Count <= 0) + this.texture = null; this.batchChanged = true; return true; }