1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 05:53:10 +08:00

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

View File

@ -73,6 +73,8 @@ namespace osu.Game.Beatmaps
// We need to include enough height to make this work for all ratio panels are displayed at. // 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); 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. // Crop the centre region of the background for now.
Rectangle cropRectangle = new Rectangle( Rectangle cropRectangle = new Rectangle(
0, 0,