Skip to content

Commit

Permalink
Use the Correct Data Types for AsepriteNinePatchProperties and `Ase…
Browse files Browse the repository at this point in the history
…pritePivotProperties` (#29)

* Use correct data type
AsepritePivotProperties and AsepriteNinPatchProperties both incorrectly used `long` instead of `int`

* Bump version number to 1.7.5
  • Loading branch information
AristurtleDev authored May 2, 2024
1 parent aac3f4a commit 793ff80
Show file tree
Hide file tree
Showing 5 changed files with 486 additions and 473 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<NeutralLanguage>en</NeutralLanguage>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>1.7.4</Version>
<Version>1.7.5</Version>
</PropertyGroup>

<!-- Setup Code Analysis using the .editorconfig file -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
// Copyright (c) Christopher Whitley. All rights reserved.
// Licensed under the MIT license.
// See LICENSE file in the project root for full license information

using System.Runtime.InteropServices;

namespace AsepriteDotNet.Aseprite.Document;

[StructLayout(LayoutKind.Explicit)]
internal struct AsepriteNinePatchProperties
{
internal const int StructSize = sizeof(long) + // X
sizeof(long) + // Y
sizeof(uint) + // Width
sizeof(uint); // Height

[FieldOffset(0)]
internal long X;

[FieldOffset(8)]
internal long Y;

[FieldOffset(16)]
internal uint Width;

[FieldOffset(20)]
internal uint Height;
}
// Copyright (c) Christopher Whitley. All rights reserved.
// Licensed under the MIT license.
// See LICENSE file in the project root for full license information
using System.Runtime.InteropServices;
namespace AsepriteDotNet.Aseprite.Document;
[StructLayout(LayoutKind.Explicit)]
internal struct AsepriteNinePatchProperties
{
internal const int StructSize = sizeof(int) + // X
sizeof(int) + // Y
sizeof(uint) + // Width
sizeof(uint); // Height
[FieldOffset(0)]
internal int X;
[FieldOffset(4)]
internal int Y;
[FieldOffset(8)]
internal uint Width;
[FieldOffset(12)]
internal uint Height;
}
40 changes: 20 additions & 20 deletions source/AsepriteDotNet/Aseprite/Document/AsepritePivotProperties.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
// Copyright (c) Christopher Whitley. All rights reserved.
// Licensed under the MIT license.
// See LICENSE file in the project root for full license information

using System.Runtime.InteropServices;

namespace AsepriteDotNet.Aseprite.Document;

[StructLayout(LayoutKind.Explicit)]
internal struct AsepritePivotProperties
{
internal const int StructSize = sizeof(long) + // X
sizeof(long); // Y

[FieldOffset(0)]
internal long X;

[FieldOffset(8)]
internal long Y;
}
// Copyright (c) Christopher Whitley. All rights reserved.
// Licensed under the MIT license.
// See LICENSE file in the project root for full license information
using System.Runtime.InteropServices;
namespace AsepriteDotNet.Aseprite.Document;
[StructLayout(LayoutKind.Explicit)]
internal struct AsepritePivotProperties
{
internal const int StructSize = sizeof(int) + // X
sizeof(int); // Y
[FieldOffset(0)]
internal int X;
[FieldOffset(4)]
internal int Y;
}
Binary file modified tests/AsepriteDotNet.Tests/Files/read-test.aseprite
Binary file not shown.
Loading

0 comments on commit 793ff80

Please sign in to comment.