Skip to content

Commit 2e39789

Browse files
Merge pull request #36 from AristurtleDev/scale-fix
Scale fix
2 parents b4a28f6 + 7bbb163 commit 2e39789

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

source/MonoGame.Aseprite.ContentPipeline/MonoGame.Aseprite.ContentPipeline.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
<RepositoryUrl>https://github.com/AristurtleDev/monogame-aseprite/</RepositoryUrl>
1313
<RepositoryType>git</RepositoryType>
1414
<PackageTags>monogame content importer processor reader aseprite animations</PackageTags>
15-
<AssemblyVersion>3.1.0.0</AssemblyVersion>
16-
<FileVersion>3.1.0.0</FileVersion>
15+
<AssemblyVersion>3.1.1.0</AssemblyVersion>
16+
<FileVersion>3.1.1.0</FileVersion>
1717
<NeutralLanguage>en</NeutralLanguage>
1818
</PropertyGroup>
1919

source/MonoGame.Aseprite/Graphics/AnimatedSprite.cs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public override int Width
114114
{
115115
get
116116
{
117-
return CurrentFrame.Bounds.Width;
117+
return CurrentFrame.Bounds.Width * (int)Scale.X;
118118
}
119119
}
120120

@@ -125,7 +125,7 @@ public override int Height
125125
{
126126
get
127127
{
128-
return CurrentFrame.Bounds.Height;
128+
return CurrentFrame.Bounds.Height * (int)Scale.Y;
129129
}
130130
}
131131

@@ -602,8 +602,15 @@ public bool TryGetCurrentFrameSlice(string sliceName, out SliceKey sliceKey)
602602
{
603603
// Update the xy-coordinate of the slicekey bounds to match the positiona
604604
// data of this animated sprite.
605-
sliceKey.Bounds.X += (int)Position.X;
606-
sliceKey.Bounds.Y += (int)Position.Y;
605+
// Hotfix, slice key needs to scale with sprite scale
606+
sliceKey.Bounds.X = (int)(Position.X + (sliceKey.Bounds.X * Scale.X));
607+
sliceKey.Bounds.Y = (int)(Position.Y + (sliceKey.Bounds.Y * Scale.Y));
608+
609+
sliceKey.Bounds.Width = (int)(sliceKey.Bounds.Width * Scale.X);
610+
sliceKey.Bounds.Height = (int)(sliceKey.Bounds.Height * Scale.Y);
611+
612+
613+
607614
return true;
608615
}
609616
else

source/MonoGame.Aseprite/MonoGame.Aseprite.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
<RepositoryUrl>https://github.com/AristurtleDev/monogame-aseprite/</RepositoryUrl>
1414
<RepositoryType>git</RepositoryType>
1515
<PackageTags>monogame content importer processor reader aseprite animations</PackageTags>
16-
<AssemblyVersion>3.1.0.0</AssemblyVersion>
17-
<FileVersion>3.1.0.0</FileVersion>
16+
<AssemblyVersion>3.1.1.0</AssemblyVersion>
17+
<FileVersion>3.1.1.0</FileVersion>
1818
<NeutralLanguage>en</NeutralLanguage>
1919
</PropertyGroup>
2020

0 commit comments

Comments
 (0)