Fix preset option packing

This commit is contained in:
Starbeamrainbowlabs 2018-08-03 20:46:21 +01:00
parent 81935c1050
commit 92328ae39c
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -7,6 +7,7 @@ using System.Configuration;
using System.Drawing.Text;
using System.Drawing.Imaging;
using System.Text;
using System.Linq;
namespace SpritePacker
{
@ -80,14 +81,10 @@ namespace SpritePacker
{
sortBySize();
List<Sprite> arrangedSprites = new List<Sprite>();
foreach(Sprite cspr in sprites)
List<Sprite> arrangedSprites = sprites.Where((Sprite spr) => spr.Placed).ToList();
List<Sprite> spritesToPack = sprites.Where((Sprite spr) => !spr.Placed).ToList();
foreach(Sprite cspr in spritesToPack)
{
if (cspr.Placed) {
if(Verbose) Console.WriteLine($"Skipping placement of {cspr} as it has been preset");
continue;
}
if(Verbose) Console.WriteLine("Attempting to place {0}.", cspr);
Point scanLines = Point.Empty;
Point nextScanLines = new Point(int.MaxValue, int.MaxValue);