Fix approach circles not scaling to circle correctly when a ski… (#5455)

Fix approach circles not scaling to circle correctly when a skin is applied
This commit is contained in:
Dean Herbert 2019-07-29 18:47:36 +09:00 committed by GitHub
commit 53a91b46e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 2 deletions

View File

@ -133,7 +133,7 @@ protected override void UpdateInitialTransforms()
base.UpdateInitialTransforms();
ApproachCircle.FadeIn(Math.Min(HitObject.TimeFadeIn * 2, HitObject.TimePreempt));
ApproachCircle.ScaleTo(1.1f, HitObject.TimePreempt);
ApproachCircle.ScaleTo(1f, HitObject.TimePreempt);
ApproachCircle.Expire(true);
}

View File

@ -6,6 +6,7 @@
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Textures;
using osu.Game.Skinning;
using osuTK;
namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
{
@ -24,7 +25,26 @@ public ApproachCircle()
[BackgroundDependencyLoader]
private void load(TextureStore textures)
{
Child = new SkinnableSprite("Play/osu/approachcircle");
Child = new SkinnableApproachCircle();
}
private class SkinnableApproachCircle : SkinnableSprite
{
public SkinnableApproachCircle()
: base("Play/osu/approachcircle")
{
}
protected override Drawable CreateDefault(string name)
{
var drawable = base.CreateDefault(name);
// account for the sprite being used for the default approach circle being taken from stable,
// when hitcircles have 5px padding on each size. this should be removed if we update the sprite.
drawable.Scale = new Vector2(128 / 118f);
return drawable;
}
}
}
}