change fixlayout function

can auto generate a more perfect layout.