mirror of https://github.com/ppy/osu
Allow storboard videos to take on no-relative size when specified by a mapper
This commit is contained in:
parent
4ae9f81c73
commit
c43c383abf
|
@ -23,7 +23,17 @@ public DrawableStoryboardVideo(StoryboardVideo video)
|
|||
{
|
||||
Video = video;
|
||||
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
// In osu-stable, a mapper can add a scale command for a storyboard.
|
||||
// This allows scaling based on the video's absolute size.
|
||||
//
|
||||
// If not specified we take up the full available space.
|
||||
bool useRelative = !video.TimelineGroup.Scale.HasCommands;
|
||||
|
||||
RelativeSizeAxes = useRelative ? Axes.Both : Axes.None;
|
||||
AutoSizeAxes = useRelative ? Axes.None : Axes.Both;
|
||||
|
||||
Anchor = Anchor.Centre;
|
||||
Origin = Anchor.Centre;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader(true)]
|
||||
|
@ -36,7 +46,7 @@ private void load(IBindable<WorkingBeatmap> beatmap, TextureStore textureStore)
|
|||
|
||||
InternalChild = drawableVideo = new Video(stream, false)
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
RelativeSizeAxes = RelativeSizeAxes,
|
||||
FillMode = FillMode.Fill,
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
|
|
Loading…
Reference in New Issue