1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 12:17:26 +08:00

Merge pull request #2256 from peppy/skin-scaling

Add scale adjusts to bring legacy skins in-line with lazer sizing
This commit is contained in:
Dean Herbert 2018-03-22 20:23:58 +09:00 committed by GitHub
commit 8b7640f137
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

View File

@ -11,6 +11,7 @@ using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Framework.IO.Stores;
using osu.Game.Database;
using OpenTK;
namespace osu.Game.Skinning
{
@ -56,10 +57,22 @@ namespace osu.Game.Skinning
break;
}
var texture = GetTexture(componentName);
float ratio = 0.72f; // brings sizing roughly in-line with stable
var texture = GetTexture($"{componentName}@2x");
if (texture == null)
{
ratio *= 2;
GetTexture(componentName);
}
if (texture == null) return null;
return new Sprite { Texture = texture };
return new Sprite
{
Texture = texture,
Scale = new Vector2(ratio),
};
}
public override Texture GetTexture(string componentName) => Textures.Get(componentName);

View File

@ -49,6 +49,7 @@ namespace osu.Game.Skinning
{
drawable.RelativeSizeAxes = Axes.Both;
drawable.Size = Vector2.One;
drawable.Scale = Vector2.One;
drawable.FillMode = FillMode.Fit;
}
}