Ejemplo n.º 1
0
        // --------------------------------------------------------------------------------
        // Name        : AddPosition
        // Description : Add new anchor point
        // --------------------------------------------------------------------------------
        public void addPosition(PackerPos p)
        {
            // Try to insert anchor as close as possible to the top left corner
            // So it will be tried first
            bool bFound = false;
            int  pos    = 0;

            foreach (PackerPos it in vPositions)
            {
                if (p.x + p.y < it.x + it.y)
                {
                    bFound = true;
                    break;
                }
                pos++;
            }
            if (bFound)
            {
                vPositions.Insert(pos, p);
            }
            else
            {
                vPositions.Add(p);
            }
        }
Ejemplo n.º 2
0
 public bool containsPoint(PackerPos p)
 {
     return (p.x >= x && p.y >= y &&
         p.x < (x + w) && p.y < (y + h));
 }
Ejemplo n.º 3
0
 public bool isEqual(PackerPos obj)
 {
     return x == obj.x && y == obj.y;
 }
Ejemplo n.º 4
0
 // --------------------------------------------------------------------------------
 // Name        : AddPosition
 // Description : Add new anchor point
 // --------------------------------------------------------------------------------
 public void addPosition(PackerPos p)
 {
     // Try to insert anchor as close as possible to the top left corner
     // So it will be tried first
     bool bFound = false;
     int pos = 0;
     foreach (PackerPos it in vPositions)
     {
         if (p.x + p.y < it.x + it.y)
         {
             bFound = true;
             break;
         }
         pos++;
     }
     if (bFound)
         vPositions.Insert(pos, p);
     else
         vPositions.Add(p);
 }
Ejemplo n.º 5
0
 public bool containsPoint(PackerPos p)
 {
     return(p.x >= x && p.y >= y &&
            p.x < (x + w) && p.y < (y + h));
 }
Ejemplo n.º 6
0
 public bool isEqual(PackerPos obj)
 {
     return(x == obj.x && y == obj.y);
 }