From 8bf63782468b7e35e8005ec2224a37746f71cf55 Mon Sep 17 00:00:00 2001 From: Tim Young Date: Wed, 20 Sep 2017 11:25:58 -0500 Subject: [PATCH] Make sure the preview sprite updates properly. --- SpriteLibrary/SpriteEntryForm.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/SpriteLibrary/SpriteEntryForm.cs b/SpriteLibrary/SpriteEntryForm.cs index f0b1037..ce8c60d 100644 --- a/SpriteLibrary/SpriteEntryForm.cs +++ b/SpriteLibrary/SpriteEntryForm.cs @@ -515,7 +515,11 @@ namespace SpriteLibrary private void WeHaveNewItem() { - if (PreviewSprite != null) PreviewSprite.Destroy(); + if (PreviewSprite != null) + { + PreviewSprite.Destroy(); + PreviewSprite = null; + } if (CurrentSIIndex >= 0 && CurrentSIIndex < SpriteInformation.Count) TempInformation.CopyFrom(SpriteInformation[CurrentSIIndex]); else @@ -626,7 +630,7 @@ namespace SpriteLibrary private void btnPreviewAnimBack_Click(object sender, EventArgs e) { - if (PreviewSprite != null) + if (PreviewSprite != null && !PreviewSprite.Destroying) { int Animations = PreviewSprite.AnimationCount; int NextAnim = PreviewSprite.AnimationIndex - 1;