Merge "Fix scaling of layout bounds." into jb-dev