Avoid potential cropping error on very tall backgrounds

This commit is contained in:
Salman Ahmed 2023-06-09 15:27:53 +03:00
parent 49c77a64ef
commit 2823a62b5f
1 changed files with 2 additions and 0 deletions

View File

@ -73,6 +73,8 @@ private TextureUpload limitTextureUploadSize(TextureUpload textureUpload)
// We need to include enough height to make this work for all ratio panels are displayed at.
int usableHeight = (int)Math.Ceiling(size.Width * 1 / minimum_display_ratio);
usableHeight = Math.Min(size.Height, usableHeight);
// Crop the centre region of the background for now.
Rectangle cropRectangle = new Rectangle(
0,