fix layout calculate problem

Change-Id: I3f5ae8304c8d9f009f3d3e126d3a59c145c335f9
tower: https://tower.im/projects/8f19f0bf0e754f0b82ef2c24bc230973/todos/d49ea24fcb3f44b6ac09b6859ef220b0/