<commit_before>// Copyright (c) 2007-2018 ppy Pty Ltd <<EMAIL>>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE

using osu.Framework.Graphics;
using osu.Framework.Input.Events;
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Osu.Edit.Blueprints.Spinners.Components;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.UI;

namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Spinners
{
    public class SpinnerPlacementBlueprint : PlacementBlueprint
    {
        public new Spinner HitObject => (Spinner)base.HitObject;

        private readonly SpinnerPiece piece;

        private bool isPlacingEnd;

        public SpinnerPlacementBlueprint()
            : base(new Spinner { Position = OsuPlayfield.BASE_SIZE / 2 })
        {
            InternalChild = piece = new SpinnerPiece(HitObject) { Alpha = 0.5f };
        }

        protected override bool OnClick(ClickEvent e)
        {
            if (isPlacingEnd)
            {
                HitObject.EndTime = EditorClock.CurrentTime;
                EndPlacement();
            }
            else
            {
                HitObject.StartTime = EditorClock.CurrentTime;

                isPlacingEnd = true;
                piece.FadeTo(1f, 150, Easing.OutQuint);
            }

            return true;
        }
    }
}<commit_msg>Fix spinners not starting placement with the first click<commit_after>// Copyright (c) 2007-2018 ppy Pty Ltd <<EMAIL>>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE

using osu.Framework.Graphics;
using osu.Framework.Input.Events;
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Osu.Edit.Blueprints.Spinners.Components;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.UI;

namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Spinners
{
    public class SpinnerPlacementBlueprint : PlacementBlueprint
    {
        public new Spinner HitObject => (Spinner)base.HitObject;

        private readonly SpinnerPiece piece;

        private bool isPlacingEnd;

        public SpinnerPlacementBlueprint()
            : base(new Spinner { Position = OsuPlayfield.BASE_SIZE / 2 })
        {
            InternalChild = piece = new SpinnerPiece(HitObject) { Alpha = 0.5f };
        }

        protected override bool OnClick(ClickEvent e)
        {
            if (isPlacingEnd)
            {
                HitObject.EndTime = EditorClock.CurrentTime;
                EndPlacement();
            }
            else
            {
                HitObject.StartTime = EditorClock.CurrentTime;

                isPlacingEnd = true;
                piece.FadeTo(1f, 150, Easing.OutQuint);

                BeginPlacement();
            }

            return true;
        }
    }
}
{'fraction_non_alphanumeric': 0.0906160458452722, 'fraction_numerical': 0.010744985673352435, 'mean_word_length': 2.0861878453038676, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 2, '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': '3022912', 'n_tokens_mistral': 856, 'n_tokens_neox': 806, 'n_words': 163}