Have the grahical selection box represent the sprite we are based off of. It seems more realistic that way.

This commit is contained in:
Tim Young 2017-09-20 16:27:35 -05:00
parent dcc9d92ca9
commit b01341439b
1 changed files with 16 additions and 0 deletions

View File

@ -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);