diff --git a/osu.Game.Modes.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Modes.Osu/Objects/Drawables/DrawableSlider.cs index 78ec817aa9..e8f2154d7f 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Modes.Osu/Objects/Drawables/DrawableSlider.cs @@ -39,6 +39,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables { body = new SliderBody(s) { + AccentColour = AccentColour, Position = s.StackedPosition, PathWidth = s.Scale * 64, }, diff --git a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/SliderBody.cs b/osu.Game.Modes.Osu/Objects/Drawables/Pieces/SliderBody.cs index 1f95be1761..e7837471ee 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/SliderBody.cs +++ b/osu.Game.Modes.Osu/Objects/Drawables/Pieces/SliderBody.cs @@ -44,7 +44,8 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces return; accentColour = value; - reloadTexture(); + if (LoadState == LoadState.Loaded) + Schedule(reloadTexture); } } @@ -99,15 +100,12 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces snakingIn = config.GetBindable(OsuConfig.SnakingInSliders); snakingOut = config.GetBindable(OsuConfig.SnakingOutSliders); - path.Texture = new Texture(textureWidth, 1); - reloadTexture(); } private void reloadTexture() { - if (path.Texture == null) - return; + var texture = new Texture(textureWidth, 1); //initialise background var upload = new TextureUpload(textureWidth * 4); @@ -142,8 +140,8 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces } } - path.Texture.SetData(upload); - path.Invalidate(Invalidation.DrawNode, this); + texture.SetData(upload); + path.Texture = texture; } private readonly List currentCurve = new List();