Beispiel #1
0
        public void DrawCurve(PCurve curve, SKCanvas canv) {
            int drawnPoints = 0;
            var step = _BrushInfoService.XSpacing;
            var div = curve.DivideLength(step);
           
            float len = 0;
            for(int i = 0;i< div.Count - 1; i++)
            {

                DrawPoint(div[i], div[i + 1], canv, drawnPoints, CurvePositionKoeficient(len, curve.Length));
                drawnPoints++;
                len += PVector.DistanceBetween(div[i], div[i + 1]).ToFloat();
            }
            PVector vec = PVector.Sub(div.Last(), div.Count>1?div[div.Count - 2]:PVector.Add(div.Last(), new PVector(0,1)));
            vec.Add(div.Last());
            DrawPoint(div.Last(), vec, canv, drawnPoints, CurvePositionKoeficient(curve.Length, curve.Length));
            drawnPoints++;
        }