From d90b2b3744bb8334de8535819bf195df0571c06a Mon Sep 17 00:00:00 2001
From: Starbeamrainbowlabs <sbrl@starbeamrainbowlabs.com>
Date: Wed, 18 May 2016 21:02:15 +0100
Subject: [PATCH] Corrected struct property issue.

---
 SpritePacker/Packer.cs           | 28 ++++++++++++++--------------
 SpritePacker/Sprite.cs           | 26 ++++++++++++++++++++++++++
 SpritePacker/SpritePacker.csproj |  3 +++
 3 files changed, 43 insertions(+), 14 deletions(-)

diff --git a/SpritePacker/Packer.cs b/SpritePacker/Packer.cs
index ba8b83e..0745b59 100644
--- a/SpritePacker/Packer.cs
+++ b/SpritePacker/Packer.cs
@@ -39,11 +39,11 @@ namespace SpritePacker
 						break;
 
 					// Scan along the X axis
-					cspr.Area.X = 0;
-					cspr.Area.Y = scanLines.Y;
+					cspr.X = 0;
+					cspr.Y = scanLines.Y;
 
 					bool foundPosition = false;
-					while(cspr.Area.X < scanLines.X)
+					while(cspr.X < scanLines.X)
 					{
 						if (!cspr.IntersectsWith(arrangedSprites))
 						{
@@ -56,24 +56,24 @@ namespace SpritePacker
 						Sprite rightProblem = problems[0];
 						foreach (Sprite probSpr in problems)
 						{
-							if (probSpr.Area.Right > rightProblem.Area.Right)
+							if (probSpr.Right > rightProblem.Right)
 								rightProblem = probSpr;
-							if (probSpr.Area.Top < nextScanLines.Y)
-								nextScanLines.Y = probSpr.Area.Top + 1;
+							if (probSpr.Top < nextScanLines.Y)
+								nextScanLines.Y = probSpr.Top + 1;
 						}
 
 						// Move up to the position furthest to the right
 						// NOTE: We may need to add one here.
-						cspr.Area.X = rightProblem.Area.Right + 1;
+						cspr.X = rightProblem.Right + 1;
 
 					}
 
 					if (!foundPosition)
 					{
 						// We didn't find anything along the x axis - let's scan the y axis next
-						cspr.Area.X = scanLines.X;
-						cspr.Area.Y = 0;
-						while (cspr.Area.Y < scanLines.Y)
+						cspr.X = scanLines.X;
+						cspr.Y = 0;
+						while (cspr.Y < scanLines.Y)
 						{
 							if (!cspr.IntersectsWith(arrangedSprites))
 							{
@@ -86,13 +86,13 @@ namespace SpritePacker
 							Sprite downProblem = problems[0];
 							foreach (Sprite probSpr in problems)
 							{
-								if (probSpr.Area.Bottom > downProblem.Area.Bottom)
+								if (probSpr.Bottom > downProblem.Bottom)
 									downProblem = probSpr;
-								if (probSpr.Area.Left < nextScanLines.X)
-									nextScanLines.X = probSpr.Area.Left + 1;
+								if (probSpr.Left < nextScanLines.X)
+									nextScanLines.X = probSpr.Left + 1;
 							}
 							// Move up to the position furthest downwards
-							cspr.Area.Y = downProblem.Area.Bottom + 1;
+							cspr.Y = downProblem.Bottom + 1;
 						}
 					}
 
diff --git a/SpritePacker/Sprite.cs b/SpritePacker/Sprite.cs
index dd0a421..16bac91 100644
--- a/SpritePacker/Sprite.cs
+++ b/SpritePacker/Sprite.cs
@@ -20,6 +20,31 @@ namespace SpritePacker
 			set { filename = value; }
 		}
 
+		public int X
+		{
+			get { return area.X; }
+			set { area.X = value; }
+		}
+		public int Y
+		{
+			get { return area.Y; }
+			set { area.Y = value; }
+		}
+		public int Width
+		{
+			get { return area.Width; }
+			set { area.Width = value; }
+		}
+		public int Height
+		{
+			get { return area.Height; }
+			set { area.Height = value; }
+		}
+		public int Top { get { return area.Top; } }
+		public int Bottom { get { return area.Bottom; } }
+		public int Left { get { return area.Left; } }
+		public int Right { get { return area.Right; } }
+
 		public Sprite(string inFilename)
 		{
 			Filename = inFilename;
@@ -35,6 +60,7 @@ namespace SpritePacker
 				if (spr.Area.Width > largestSoFar)
 					largestSoFar = spr.Area.Width;
 			}
+			return largestSoFar;
 		}
 
 		public List<Sprite> GetIntersectors(List<Sprite> spriteList)
diff --git a/SpritePacker/SpritePacker.csproj b/SpritePacker/SpritePacker.csproj
index 651a6e7..590fc7f 100644
--- a/SpritePacker/SpritePacker.csproj
+++ b/SpritePacker/SpritePacker.csproj
@@ -40,4 +40,7 @@
     <Compile Include="Sprite.cs" />
   </ItemGroup>
   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <ItemGroup>
+    <EmbeddedResource Include="Help.txt" />
+  </ItemGroup>
 </Project>
\ No newline at end of file
