Merge "Compute nearest frames after layout" into sc-dev