issue #3861, fix layout contentSize caculation