Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.11 KB | None | 0 0
  1.     public void makeList()
  2.     {
  3.         boolean done = false;
  4.         int count = 0;
  5.         int count2 = 0;
  6.         do{
  7.           if(rWidth >= smallRect.getWidth() &&
  8.            rHeight >= smallRect.getHeight() )
  9.           {
  10.             rWidth = rWidth - smallRect.getWidth();
  11.             rHeight = rHeight - smallRect.getWidth();
  12.             smRectArr.add(smallRect);
  13.             smRectInfo.setNew();
  14.             smallRect.setWidth(smRectInfo.getWidth());
  15.             smallRect.setHeight(smRectInfo.getHeight());
  16.            
  17.           }
  18.           else if(rWidth >= smallRect.getWidth())
  19.           {
  20.             smRectInfo.setNewH();
  21.             smallRect.setHeight(smRectInfo.getHeight());
  22.             count++;
  23.           }
  24.             else if(rHeight >= smallRect.getWidth())
  25.           {
  26.             smRectInfo.setNewW();
  27.             smallRect.setWidth(smRectInfo.getWidth());
  28.             count2++;
  29.         }
  30.         else
  31.         {
  32.             done = true;
  33.         }
  34.        
  35.         if(count == 3 || count2 == 3)
  36.         {
  37.             done = true;
  38.         }
  39.        
  40.        }while(!done);
  41.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement