1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 08:32:57 +08:00

Allow storyboards to be widescreen if only a video element exists

This matches stable behaviour, which will allow videos to display
filling the screen if they are the only thing contained within the
"storyboard".
This commit is contained in:
Dean Herbert 2021-05-25 16:07:17 +09:00
parent e3507d5453
commit 0c55bba220

View File

@ -57,9 +57,12 @@ namespace osu.Game.Storyboards.Drawables
public DrawableStoryboard(Storyboard storyboard)
{
Storyboard = storyboard;
Size = new Vector2(640, 480);
Width = Height * (storyboard.BeatmapInfo.WidescreenStoryboard ? 16 / 9f : 4 / 3f);
bool onlyHasVideoElements = !Storyboard.Layers.Any(l => l.Elements.Any(e => !(e is StoryboardVideo)));
Width = Height * (storyboard.BeatmapInfo.WidescreenStoryboard || onlyHasVideoElements ? 16 / 9f : 4 / 3f);
Anchor = Anchor.Centre;
Origin = Anchor.Centre;