From b01341439bd4b4516cf387f8c685bf3cc697bf39 Mon Sep 17 00:00:00 2001 From: Tim Young Date: Wed, 20 Sep 2017 16:27:35 -0500 Subject: [PATCH] Have the grahical selection box represent the sprite we are based off of. It seems more realistic that way. --- SpriteLibrary/SpriteEntryForm.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/SpriteLibrary/SpriteEntryForm.cs b/SpriteLibrary/SpriteEntryForm.cs index a30b2d7..d17e286 100644 --- a/SpriteLibrary/SpriteEntryForm.cs +++ b/SpriteLibrary/SpriteEntryForm.cs @@ -527,6 +527,22 @@ namespace SpriteLibrary { if (!VerifySpriteBeforeSaving()) return; FormToSpriteInformation(); + //Copy information from the frame we are based off of. This makes the visible selection + //equal to the one it is a copy of. + if(CurrentSIAnimation >=0 && TempInformation.Animations[CurrentSIAnimation].FieldsToUse != AnimationType.SpriteDefinition) + { + int which = TempInformation.Animations[CurrentSIAnimation].AnimationToUse; + if (which >= 0 && which < TempInformation.Animations.Count) + { + AnimationInfo oAI = TempInformation.Animations[TempInformation.Animations[CurrentSIAnimation].AnimationToUse]; + AnimationInfo nAI = TempInformation.Animations[CurrentSIAnimation]; + nAI.ImageName = oAI.ImageName; + nAI.StartPoint = oAI.StartPoint; + nAI.Width = oAI.Width; + nAI.Height = oAI.Height; + nAI.NumFrames = oAI.NumFrames; + } + } if (CurrentSIIndex > 0 && CurrentSIIndex < SpriteInformation.Count) { SpriteInformation[CurrentSIIndex].CopyFrom(TempInformation);