From 0389b3a75996c65dad27d441e598fd530444a9eb Mon Sep 17 00:00:00 2001
From: Tim Young <tim.young@lightsys.org>
Date: Tue, 19 Sep 2017 13:22:25 -0500
Subject: [PATCH] destroy the sprite if we were doing a preview

---
 SpriteLibrary/SpriteEntryForm.cs | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/SpriteLibrary/SpriteEntryForm.cs b/SpriteLibrary/SpriteEntryForm.cs
index 41a2827..6f2b924 100644
--- a/SpriteLibrary/SpriteEntryForm.cs
+++ b/SpriteLibrary/SpriteEntryForm.cs
@@ -432,6 +432,7 @@ namespace SpriteLibrary
 
         private void WeHaveNewItem()
         {
+            if (PreviewSprite != null) PreviewSprite.Destroy();
             TempInformation.CopyFrom(SpriteInformation[CurrentSIIndex]);
             SpriteInformationToForm();
             UpdateMenu();
@@ -441,7 +442,9 @@ namespace SpriteLibrary
             if (nindex < 0) return;
             if (nindex >= SpriteInformation.Count) return;
             CurrentSIIndex = nindex;
+            if (PreviewSprite != null) PreviewSprite.Destroy();
             TempInformation = SpriteInformation[nindex].Clone();
+            CurrentSIAnimation = 0; //always start at animation 0
             WeHaveNewItem();
             UpdateMenu();
         }