From 4a93abcc36c9ec8e108892c0f3f257a66e6ffce0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 21 Mar 2018 20:06:36 +0900 Subject: [PATCH] Add scale adjusts to bring legacy skins in-line with lazer sizing --- osu.Game/Skinning/LegacySkin.cs | 20 +++++++++++++++++--- osu.Game/Skinning/SkinnableDrawable.cs | 1 + 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/osu.Game/Skinning/LegacySkin.cs b/osu.Game/Skinning/LegacySkin.cs index c543537f32..a361fa2b8a 100644 --- a/osu.Game/Skinning/LegacySkin.cs +++ b/osu.Game/Skinning/LegacySkin.cs @@ -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 { @@ -35,7 +36,8 @@ namespace osu.Game.Skinning Configuration = new SkinConfiguration(); } - protected LegacySkin(SkinInfo skin) : base(skin) + protected LegacySkin(SkinInfo skin) + : base(skin) { } @@ -57,10 +59,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); diff --git a/osu.Game/Skinning/SkinnableDrawable.cs b/osu.Game/Skinning/SkinnableDrawable.cs index 9314d16c39..09d2e6a3ed 100644 --- a/osu.Game/Skinning/SkinnableDrawable.cs +++ b/osu.Game/Skinning/SkinnableDrawable.cs @@ -49,6 +49,7 @@ namespace osu.Game.Skinning { drawable.RelativeSizeAxes = Axes.Both; drawable.Size = Vector2.One; + drawable.Scale = Vector2.One; drawable.FillMode = FillMode.Fit; } }