AlphaTab.Rendering.Glyphs.BendGlyph.Paint C# (CSharp) Метод

Paint() публичный Метод

public Paint ( float cx, float cy, ICanvas canvas ) : void
cx float
cy float
canvas ICanvas
Результат void
        public override void Paint(float cx, float cy, ICanvas canvas)
        {
            // calculate offsets per step
            var dX = Width / BendPoint.MaxPosition;
            var maxValue = 0;
            for (int i = 0, j = _note.BendPoints.Count; i < j; i++)
            {
                if (_note.BendPoints[i].Value > maxValue)
                {
                    maxValue = _note.BendPoints[i].Value;
                }
            }

            cx += X;
            cy += Y;

            canvas.BeginPath();
            for (int i = 0, j = _note.BendPoints.Count - 1; i < j; i++)
            {
                var firstPt = _note.BendPoints[i];
                var secondPt = _note.BendPoints[i + 1];

                // draw pre-bend if previous
                if (i == 0 && firstPt.Value != 0 && !_note.IsTieDestination)
                {
                    PaintBend(new BendPoint(), firstPt, cx, cy, dX, canvas);
                }

                // don't draw a line if there's no offset and it's the last point
                if (firstPt.Value == secondPt.Value && i == _note.BendPoints.Count - 2) continue;

                PaintBend(firstPt, secondPt,  cx, cy, dX, canvas);
            }
        }