Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void makeList()
- {
- boolean done = false;
- int count = 0;
- int count2 = 0;
- do{
- if(rWidth >= smallRect.getWidth() &&
- rHeight >= smallRect.getHeight() )
- {
- rWidth = rWidth - smallRect.getWidth();
- rHeight = rHeight - smallRect.getWidth();
- smRectArr.add(smallRect);
- smRectInfo.setNew();
- smallRect.setWidth(smRectInfo.getWidth());
- smallRect.setHeight(smRectInfo.getHeight());
- }
- else if(rWidth >= smallRect.getWidth())
- {
- smRectInfo.setNewH();
- smallRect.setHeight(smRectInfo.getHeight());
- count++;
- }
- else if(rHeight >= smallRect.getWidth())
- {
- smRectInfo.setNewW();
- smallRect.setWidth(smRectInfo.getWidth());
- count2++;
- }
- else
- {
- done = true;
- }
- if(count == 3 || count2 == 3)
- {
- done = true;
- }
- }while(!done);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement