mirror of
https://github.com/ppy/osu
synced 2025-02-13 16:47:38 +00:00
Make GetTexture return the post-scaled texture
This commit is contained in:
parent
16d74a5983
commit
b84994e643
@ -58,25 +58,29 @@ namespace osu.Game.Skinning
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
float ratio = 0.72f; // brings sizing roughly in-line with stable
|
var texture = GetTexture(componentName);
|
||||||
|
|
||||||
var texture = GetTexture($"{componentName}@2x");
|
|
||||||
if (texture == null)
|
|
||||||
{
|
|
||||||
ratio *= 2;
|
|
||||||
texture = GetTexture(componentName);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (texture == null) return null;
|
if (texture == null) return null;
|
||||||
|
|
||||||
return new Sprite
|
return new Sprite { Texture = texture };
|
||||||
{
|
|
||||||
Texture = texture,
|
|
||||||
Scale = new Vector2(ratio),
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Texture GetTexture(string componentName) => Textures.Get(componentName);
|
public override Texture GetTexture(string componentName)
|
||||||
|
{
|
||||||
|
float ratio = 2;
|
||||||
|
|
||||||
|
var texture = Textures.Get($"{componentName}@2x");
|
||||||
|
if (texture == null)
|
||||||
|
{
|
||||||
|
ratio = 1;
|
||||||
|
texture = Textures.Get(componentName);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (texture != null)
|
||||||
|
texture.ScaleAdjust = ratio / 0.72f; // brings sizing roughly in-line with stable
|
||||||
|
|
||||||
|
return texture;
|
||||||
|
}
|
||||||
|
|
||||||
public override SampleChannel GetSample(string sampleName) => Samples.Get(sampleName);
|
public override SampleChannel GetSample(string sampleName) => Samples.Get(sampleName);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user