mirror of
https://github.com/ppy/osu.git
synced 2025-01-27 13:23:05 +08:00
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 @@ namespace osu.Game.Storyboards.Drawables
|
|||||||
{
|
{
|
||||||
Video = 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)]
|
[BackgroundDependencyLoader(true)]
|
||||||
@ -36,7 +46,7 @@ namespace osu.Game.Storyboards.Drawables
|
|||||||
|
|
||||||
InternalChild = drawableVideo = new Video(stream, false)
|
InternalChild = drawableVideo = new Video(stream, false)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = RelativeSizeAxes,
|
||||||
FillMode = FillMode.Fill,
|
FillMode = FillMode.Fill,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
|
Loading…
Reference in New Issue
Block a user