Merge "Simplify matrix calculations for display adjustment"