In Xiaomi devices, there are drawn an image outside of camera's letterbox In other devices everything is correct I attached both sumsung and xiaomi images, the screenshot that looks ugly is xiaomi Code (CSharp): float targetaspect = 750f / 1334f; // determine the game window's current aspect ratio float windowaspect = (float)Screen.width / (float)Screen.height; // current viewport height should be scaled by this amount float scaleheight = windowaspect / targetaspect; // obtain camera component so we can modify its viewport Camera camera = GetComponent<Camera>(); // if scaled height is less than current height, add letterbox if (scaleheight < 1.0f) { Rect rect = camera.rect; rect.width = 1.0f; rect.height = scaleheight; rect.x = 0; rect.y = (1.0f - scaleheight) / 2.0f; camera.rect = rect; }
You just posted in the wrong forum. Please hit the Report link on your initial post and ask the moderators to move it into the Platforms/Xiaomi forum, where there are clever people who probably can help with your problem. General Discussion isn't a support forum.