AlphaTab.Rendering.Glyphs.TripletFeelGlyph.Paint C# (CSharp) Method

Paint() public method

public Paint ( float cx, float cy, ICanvas canvas ) : void
cx float
cy float
canvas ICanvas
return void
        public override void Paint(float cx, float cy, ICanvas canvas)
        {
            cx += X;
            cy += Y;

            var noteY = cy + Renderer.Height * 0.75f;
            canvas.Font = Renderer.Resources.EffectFont;

            canvas.FillText("(", cx, cy + Renderer.Height * 0.3f);

            var leftNoteX = cx + (10 * Scale);
            var rightNoteX = cx + (40 * Scale);

            switch (_tripletFeel)
            {
                case TripletFeel.NoTripletFeel:
                    RenderBarNote(leftNoteX, noteY, NoteScale, canvas, new[] { BarType.Full });
                    RenderBarNote(rightNoteX, noteY, NoteScale, canvas, new[] { BarType.Full });
                    break;

                case TripletFeel.Triplet8th:
                    RenderBarNote(leftNoteX, noteY, NoteScale, canvas, new[] { BarType.Full });

                    canvas.FillMusicFontSymbol(rightNoteX, noteY, NoteScale, MusicFontSymbol.Tempo);
                    canvas.FillMusicFontSymbol(rightNoteX + (NoteSeparation * Scale), noteY, NoteScale, MusicFontSymbol.NoteEighth);

                    RenderTriplet(rightNoteX, cy, canvas);
                    break;

                case TripletFeel.Triplet16th:
                    RenderBarNote(leftNoteX, noteY, NoteScale, canvas, new[] { BarType.Full, BarType.Full });

                    RenderBarNote(rightNoteX, noteY, NoteScale, canvas, new[] { BarType.Full, BarType.PartialRight });
                    RenderTriplet(rightNoteX, cy, canvas);
                    break;

                case TripletFeel.Dotted8th:
                    RenderBarNote(leftNoteX, noteY, NoteScale, canvas, new[] { BarType.Full });

                    RenderBarNote(rightNoteX, noteY, NoteScale, canvas, new[] { BarType.Full, BarType.PartialRight });
                    canvas.FillCircle(rightNoteX + (9 * Scale), noteY, Scale);
                    break;

                case TripletFeel.Dotted16th:
                    RenderBarNote(leftNoteX, noteY, NoteScale, canvas, new[] { BarType.Full, BarType.Full });

                    RenderBarNote(rightNoteX, noteY, NoteScale, canvas, new[] { BarType.Full, BarType.Full, BarType.PartialRight });
                    canvas.FillCircle(rightNoteX + (9 * Scale), noteY, Scale);
                    break;

                case TripletFeel.Scottish8th:
                    RenderBarNote(leftNoteX, noteY, NoteScale, canvas, new[] { BarType.Full });

                    RenderBarNote(rightNoteX, noteY, NoteScale, canvas, new[] { BarType.Full, BarType.PartialLeft,  });
                    canvas.FillCircle(rightNoteX + (NoteSeparation * Scale)+ (8 * Scale), noteY, Scale);
                    break;

                case TripletFeel.Scottish16th:
                    RenderBarNote(leftNoteX, noteY, NoteScale, canvas, new[] { BarType.Full, BarType.Full });

                    RenderBarNote(rightNoteX, noteY, NoteScale, canvas, new[] { BarType.Full, BarType.Full, BarType.PartialLeft, });
                    canvas.FillCircle(rightNoteX + (NoteSeparation * Scale) + (8 * Scale), noteY, Scale);
                    break;
            }

            canvas.FillText("=", cx + (30 * Scale), cy + (5 * Scale));
            canvas.FillText(")", cx + (65 * Scale), cy + Renderer.Height * 0.3f);
        }