Make sure the preview sprite updates properly.

This commit is contained in:
Tim Young 2017-09-20 11:25:58 -05:00
parent 35133e64b7
commit 8bf6378246

View File

@ -515,7 +515,11 @@ namespace SpriteLibrary
private void WeHaveNewItem() private void WeHaveNewItem()
{ {
if (PreviewSprite != null) PreviewSprite.Destroy(); if (PreviewSprite != null)
{
PreviewSprite.Destroy();
PreviewSprite = null;
}
if (CurrentSIIndex >= 0 && CurrentSIIndex < SpriteInformation.Count) if (CurrentSIIndex >= 0 && CurrentSIIndex < SpriteInformation.Count)
TempInformation.CopyFrom(SpriteInformation[CurrentSIIndex]); TempInformation.CopyFrom(SpriteInformation[CurrentSIIndex]);
else else
@ -626,7 +630,7 @@ namespace SpriteLibrary
private void btnPreviewAnimBack_Click(object sender, EventArgs e) private void btnPreviewAnimBack_Click(object sender, EventArgs e)
{ {
if (PreviewSprite != null) if (PreviewSprite != null && !PreviewSprite.Destroying)
{ {
int Animations = PreviewSprite.AnimationCount; int Animations = PreviewSprite.AnimationCount;
int NextAnim = PreviewSprite.AnimationIndex - 1; int NextAnim = PreviewSprite.AnimationIndex - 1;