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
1 changed files with 4 additions and 1 deletions

View File

@ -57,9 +57,12 @@ protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnl
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;