mirror of
https://github.com/ppy/osu.git
synced 2024-11-14 17:17:24 +08:00
560f71ef53
Closes https://github.com/ppy/osu/issues/23210. Ballparked the fix to work down to the lowest resolution we support. The previous number (`2.5f`) was also likely ballparked so the fix seems in line with expectations. I don't want to put too much thought into this because the design of this screen is likely going to change in the mean time anyway.
55 lines
1.3 KiB
C#
55 lines
1.3 KiB
C#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
#nullable disable
|
|
|
|
using osu.Framework.Allocation;
|
|
using osu.Framework.Graphics;
|
|
using osu.Framework.Graphics.Containers;
|
|
using osu.Framework.Graphics.Sprites;
|
|
using osu.Game.Graphics;
|
|
using osuTK;
|
|
|
|
namespace osu.Game.Screens.Play.Break
|
|
{
|
|
public partial class BlurredIcon : BufferedContainer
|
|
{
|
|
private readonly SpriteIcon icon;
|
|
|
|
public IconUsage Icon
|
|
{
|
|
set => icon.Icon = value;
|
|
get => icon.Icon;
|
|
}
|
|
|
|
public override Vector2 Size
|
|
{
|
|
set
|
|
{
|
|
icon.Size = value;
|
|
base.Size = value + BlurSigma * 5;
|
|
ForceRedraw();
|
|
}
|
|
get => base.Size;
|
|
}
|
|
|
|
public BlurredIcon()
|
|
: base(cachedFrameBuffer: true)
|
|
{
|
|
RelativePositionAxes = Axes.X;
|
|
Child = icon = new SpriteIcon
|
|
{
|
|
Origin = Anchor.Centre,
|
|
Anchor = Anchor.Centre,
|
|
Shadow = false,
|
|
};
|
|
}
|
|
|
|
[BackgroundDependencyLoader]
|
|
private void load(OsuColour colours)
|
|
{
|
|
Colour = colours.BlueLighter;
|
|
}
|
|
}
|
|
}
|