AlphaTab.Rendering.ScoreBarRenderer.PaintFingering C# (CSharp) Method

PaintFingering() private method

private PaintFingering ( ICanvas canvas, Beat beat, float beatLineX, BeamDirection direction, float topY ) : void
canvas ICanvas
beat AlphaTab.Model.Beat
beatLineX float
direction BeamDirection
topY float
return void
        private void PaintFingering(ICanvas canvas, Beat beat, float beatLineX, BeamDirection direction, float topY)
        {
            if (direction == BeamDirection.Up)
            {
                beatLineX -= 10 * Scale;
            }
            else
            {
                beatLineX += 3 * Scale;
            }

            // sort notes ascending in their value to ensure
            // we are drawing the numbers according to their order on the stave
            var noteList = beat.Notes.Clone();
            noteList.Sort((a, b) => b.RealValue - a.RealValue);

            for (int n = 0; n < noteList.Count; n++)
            {
                var note = noteList[n];
                string text = null;
                if (note.LeftHandFinger != Fingers.Unknown)
                {
                    text = FingerToString(beat, note.LeftHandFinger, true);
                }
                else if (note.RightHandFinger != Fingers.Unknown)
                {
                    text = FingerToString(beat, note.RightHandFinger, false);
                }

                if (text == null)
                {
                    continue;
                }

                canvas.FillText(text, beatLineX, topY);
                topY -= (int)(canvas.Font.Size);
            }
        }