<commit_before>﻿// Copyright (c) ppy Pty Ltd <<EMAIL>>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Utils;
using osu.Game.Rulesets.Osu.Objects.Drawables;
using osuTK.Graphics;

namespace osu.Game.Rulesets.Osu.Skinning.Default
{
    public class DefaultFollowCircle : FollowCircle
    {
        public DefaultFollowCircle()
        {
            InternalChild = new CircularContainer
            {
                RelativeSizeAxes = Axes.Both,
                Masking = true,
                BorderThickness = 5,
                BorderColour = Color4.Orange,
                Blending = BlendingParameters.Additive,
                Child = new Box
                {
                    Colour = Color4.Orange,
                    RelativeSizeAxes = Axes.Both,
                    Alpha = 0.2f,
                }
            };
        }

        protected override void OnTrackingChanged(ValueChangedEvent<bool> tracking)
        {
            const float duration = 300f;

            if (tracking.NewValue)
            {
                if (Precision.AlmostEquals(0, Alpha))
                    this.ScaleTo(1);

                this.ScaleTo(DrawableSliderBall.FOLLOW_AREA, duration, Easing.OutQuint)
                    .FadeTo(1f, duration, Easing.OutQuint);
            }
            else
            {
                this.ScaleTo(DrawableSliderBall.FOLLOW_AREA * 1.2f, duration / 2, Easing.OutQuint)
                    .FadeTo(0, duration / 2, Easing.OutQuint);
            }
        }

        protected override void OnSliderEnd()
        {
            const float fade_duration = 450f;

            // intentionally pile on an extra FadeOut to make it happen much faster
            this.FadeOut(fade_duration / 4, Easing.Out);
        }
    }
}<commit_msg>Fix animation changes incorrectly applying to successful completion of sliders<commit_after>﻿// Copyright (c) p<NAME> <<EMAIL>>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System.Diagnostics;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Utils;
using osu.Game.Rulesets.Osu.Objects.Drawables;
using osuTK.Graphics;

namespace osu.Game.Rulesets.Osu.Skinning.Default
{
    public class DefaultFollowCircle : FollowCircle
    {
        public DefaultFollowCircle()
        {
            InternalChild = new CircularContainer
            {
                RelativeSizeAxes = Axes.Both,
                Masking = true,
                BorderThickness = 5,
                BorderColour = Color4.Orange,
                Blending = BlendingParameters.Additive,
                Child = new Box
                {
                    Colour = Color4.Orange,
                    RelativeSizeAxes = Axes.Both,
                    Alpha = 0.2f,
                }
            };
        }

        protected override void OnTrackingChanged(ValueChangedEvent<bool> tracking)
        {
            Debug.Assert(ParentObject != null);

            const float duration = 300f;

            if (ParentObject.Judged)
                return;

            if (tracking.NewValue)
            {
                if (Precision.AlmostEquals(0, Alpha))
                    this.ScaleTo(1);

                this.ScaleTo(DrawableSliderBall.FOLLOW_AREA, duration, Easing.OutQuint)
                    .FadeTo(1f, duration, Easing.OutQuint);
            }
            else
            {
                this.ScaleTo(DrawableSliderBall.FOLLOW_AREA * 1.2f, duration / 2, Easing.OutQuint)
                    .FadeTo(0, duration / 2, Easing.OutQuint);
            }
        }

        protected override void OnSliderEnd()
        {
            const float fade_duration = 300;

            // intentionally pile on an extra FadeOut to make it happen much faster
            this.ScaleTo(1, fade_duration, Easing.OutQuint);
            this.FadeOut(fade_duration / 2, Easing.OutQuint);
        }
    }
}
{'fraction_non_alphanumeric': 0.07917749940912314, 'fraction_numerical': 0.009690380524698653, 'mean_word_length': 1.6549560853199499, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5525858', 'n_tokens_mistral': 1239, 'n_tokens_neox': 1135, 'n_words': 261}