1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-26 19:32:55 +08:00

Fix ConstrainedIconContainer always using masking

This commit is contained in:
Andrei Zavatski 2024-01-18 04:06:02 +03:00
parent e260e75fac
commit 42e4c933d3
3 changed files with 1 additions and 29 deletions

View File

@ -92,7 +92,6 @@ namespace osu.Game.Beatmaps.Drawables
EdgeEffect = new EdgeEffectParameters EdgeEffect = new EdgeEffectParameters
{ {
Colour = Color4.Black.Opacity(0.06f), Colour = Color4.Black.Opacity(0.06f),
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,
Radius = 3, Radius = 3,
}, },

View File

@ -4,7 +4,6 @@
using System; using System;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Effects;
using osuTK; using osuTK;
namespace osu.Game.Graphics.Containers namespace osu.Game.Graphics.Containers
@ -17,21 +16,9 @@ namespace osu.Game.Graphics.Containers
public Drawable Icon public Drawable Icon
{ {
get => InternalChild; get => InternalChild;
set => InternalChild = value; set => InternalChild = value;
} }
/// <summary>
/// Determines an edge effect of this <see cref="Container"/>.
/// Edge effects are e.g. glow or a shadow.
/// Only has an effect when <see cref="CompositeDrawable.Masking"/> is true.
/// </summary>
public new EdgeEffectParameters EdgeEffect
{
get => base.EdgeEffect;
set => base.EdgeEffect = value;
}
protected override void Update() protected override void Update()
{ {
base.Update(); base.Update();
@ -49,10 +36,5 @@ namespace osu.Game.Graphics.Containers
InternalChild.Origin = Anchor.Centre; InternalChild.Origin = Anchor.Centre;
} }
} }
public ConstrainedIconContainer()
{
Masking = true;
}
} }
} }

View File

@ -4,7 +4,6 @@
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Effects;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
using osu.Game.Graphics; using osu.Game.Graphics;
@ -58,15 +57,7 @@ namespace osu.Game.Overlays.Toolbar
{ {
set => Scheduler.AddOnce(() => set => Scheduler.AddOnce(() =>
{ {
if (value) IconContainer.Colour = value ? Color4Extensions.FromHex("#00FFAA") : colours.GrayF;
{
IconContainer.Colour = Color4Extensions.FromHex("#00FFAA");
}
else
{
IconContainer.Colour = colours.GrayF;
IconContainer.EdgeEffect = new EdgeEffectParameters();
}
}); });
} }