AlphaTab.Rendering.Utils.BarBounds.FindBeatAtPos C# (CSharp) Method

FindBeatAtPos() public method

public FindBeatAtPos ( float x ) : BeatBounds
x float
return BeatBounds
        public BeatBounds FindBeatAtPos(float x)
        {
            BeatBounds beat = null;
            for (int i = 0; i < Beats.Count; i++)
            {
                if (beat == null || Beats[i].RealBounds.X < x)
                {
                    beat = Beats[i];
                }
                else if (Beats[i].RealBounds.X > x)
                {
                    break;
                }
            }
            return beat;
        }