1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 14:07:25 +08:00

Don't apply gradient to non-duration objects

This commit is contained in:
Dean Herbert 2020-09-29 17:34:50 +09:00
parent c47652c97a
commit 6e1ea00443

View File

@ -91,9 +91,6 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
Size = new Vector2(circle_size),
Anchor = Anchor.CentreLeft,
Origin = Anchor.Centre,
RelativePositionAxes = Axes.X,
AlwaysPresent = true,
Colour = Color4.White,
EdgeEffect = new EdgeEffectParameters
{
Type = EdgeEffectType.Shadow,
@ -183,7 +180,10 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
comboColour = drawableHitObject.AccentColour.GetBoundCopy();
comboColour.BindValueChanged(colour =>
{
mainComponents.Colour = ColourInfo.GradientHorizontal(drawableHitObject.AccentColour.Value, Color4.White);
if (HitObject is IHasDuration)
mainComponents.Colour = ColourInfo.GradientHorizontal(drawableHitObject.AccentColour.Value, Color4.White);
else
mainComponents.Colour = drawableHitObject.AccentColour.Value;
var col = mainComponents.Colour.AverageColour.Linear;
float brightness = col.R + col.G + col.B;