Merge pull request #5910 from peppy/fix-legacy-skin-text

Fix legacy skin text reading from the wrong source
This commit is contained in:
Dean Herbert 2019-08-31 21:51:26 +09:00 committed by GitHub
commit ee4869647f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -99,7 +99,7 @@ public Drawable GetDrawableComponent(string componentName)
return !hasFont(font)
? null
: new LegacySpriteText(this, font)
: new LegacySpriteText(source, font)
{
// Spacing value was reverse-engineered from the ratio of the rendered sprite size in the visual inspector vs the actual texture size
Scale = new Vector2(0.96f),
@ -110,13 +110,13 @@ public Drawable GetDrawableComponent(string componentName)
return null;
}
public Texture GetTexture(string componentName) => null;
public Texture GetTexture(string componentName) => source.GetTexture(componentName);
public SampleChannel GetSample(ISampleInfo sample) => null;
public SampleChannel GetSample(ISampleInfo sample) => source.GetSample(sample);
public TValue GetValue<TConfiguration, TValue>(Func<TConfiguration, TValue> query) where TConfiguration : SkinConfiguration
=> configuration.Value is TConfiguration conf ? query.Invoke(conf) : source.GetValue(query);
private bool hasFont(string fontName) => GetTexture($"{fontName}-0") != null;
private bool hasFont(string fontName) => source.GetTexture($"{fontName}-0") != null;
}
}