, .
- .
, , , . / /. , .
, , .
. , . :.
Take items in order of display preference
Start at the top-left
For each item:
Try to stack horizontally, going right ("favoring" left)
if it won't fit on the screen:
try to stack on the next row
when trying to stack on the next row:
if any "gaps" exist in the current row:
see if you have a less "regular" rectangle that will fit in the gap
else
"favor" placing it farther left
Edit:
.
, , , - , - , - .
, , . 1x1, , , , . , , . , / , , .