1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-01 00:39:11 +08:00

Avoid unnecessarily creating buffered container for zero-blur

This commit is contained in:
Dean Herbert 2019-07-15 11:46:41 +09:00
parent d093eb6660
commit 2186ffda55

View File

@ -1,4 +1,4 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation; using osu.Framework.Allocation;
@ -51,7 +51,7 @@ namespace osu.Game.Graphics.Backgrounds
/// <returns>A <see cref="TransformSequence{T}"/> to which further transforms can be added.</returns> /// <returns>A <see cref="TransformSequence{T}"/> to which further transforms can be added.</returns>
public void BlurTo(Vector2 newBlurSigma, double duration = 0, Easing easing = Easing.None) public void BlurTo(Vector2 newBlurSigma, double duration = 0, Easing easing = Easing.None)
{ {
if (bufferedContainer == null) if (bufferedContainer == null && newBlurSigma != Vector2.Zero)
{ {
RemoveInternal(Sprite); RemoveInternal(Sprite);