1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 02:13:21 +08:00

Use FillMode in more cases.

This commit is contained in:
Dean Herbert 2016-11-23 13:18:22 +09:00
parent 2e05ec0296
commit 60d939f323
2 changed files with 4 additions and 14 deletions

View File

@ -28,7 +28,8 @@ namespace osu.Game.Graphics.Backgrounds
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Colour = Color4.DarkGray
Colour = Color4.DarkGray,
FillMode = FillMode.Fill,
});
}
@ -38,11 +39,5 @@ namespace osu.Game.Graphics.Backgrounds
if (!string.IsNullOrEmpty(textureName))
Sprite.Texture = textures.Get(textureName);
}
protected override void Update()
{
base.Update();
Sprite.Scale = new Vector2(Math.Max(DrawSize.X / Sprite.DrawSize.X, DrawSize.Y / Sprite.DrawSize.Y));
}
}
}

View File

@ -392,7 +392,8 @@ namespace osu.Game.Overlays
{
sprite = new Sprite
{
Colour = new Color4(150, 150, 150, 255)
Colour = new Color4(150, 150, 150, 255),
FillMode = FillMode.Fill,
},
new Box
{
@ -410,12 +411,6 @@ namespace osu.Game.Overlays
{
sprite.Texture = beatmap?.Background ?? textures.Get(@"Backgrounds/bg4");
}
protected override void LoadComplete()
{
base.LoadComplete();
sprite.Scale = new Vector2(Math.Max(DrawSize.X / sprite.DrawSize.X, DrawSize.Y / sprite.DrawSize.Y));
}
}
}
}