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

View File

@ -527,6 +527,22 @@ namespace SpriteLibrary
{ {
if (!VerifySpriteBeforeSaving()) return; if (!VerifySpriteBeforeSaving()) return;
FormToSpriteInformation(); 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) if (CurrentSIIndex > 0 && CurrentSIIndex < SpriteInformation.Count)
{ {
SpriteInformation[CurrentSIIndex].CopyFrom(TempInformation); SpriteInformation[CurrentSIIndex].CopyFrom(TempInformation);