Exemplo n.º 1
0
    void InsertBezierSegment(BezierSegment insertedSegment, BezierSegment neighborSegment, BezierSegment segment)
    {
        int index = _currentHoverData.HoveredSegmentPointIndex;

        insertedSegment.CopySegmentsPoint(segment.SegmentPoints, index);
        segment.RemoveSegmentPoints(index);

        int currentRange = _currentHoverData.HoveredSegmentIndex;

        if (currentRange != 0)
        {
            _segments.Insert(currentRange, insertedSegment);
        }
        else
        {
            _segments.Add(insertedSegment);
        }

        OrganizeNeighbors(insertedSegment, segment);
        OrganizeNeighbors(neighborSegment, insertedSegment);

        insertedSegment.Update();
        segment.Update();

        _currentPathObject.SegmentCount++;
    }
Exemplo n.º 2
0
    public void CloseCurve()
    {
        BezierSegment first = _segments[0];

        first.isFirst      = false;
        first.SegmentCount = _program.SEGMENTS_PER_CURVE;
        first.Delete();
        first.AddCurvePoints();
        BezierSegment last = _segments[_segments.Count - 1];

        OrganizeNeighbors(last, _segments[0]);
        first.Update();

        first.PointSelected         = false;
        last.PointSelected          = false;
        _currentPathObject.IsClosed = true;

        _currentPathObject.UpdatePointsHandlesRenderer();
        _program.AllowPathObjectUpdate();
    }