demo/index.js
function fixCurves() {
                        if (point[0] == 0) start = point[1];
                        if (point[0] == 1) end = point[1];
                        var points = filter[curves.name];
                        var foundStart = false;
                        var foundEnd = false;
                        for (var i = 0; i < points.length; i++) {
                            var p = points[i];
                            if (p[0] == 0) {
                                foundStart = true;
                                if (point[0] == 0 && p != point) points.splice(i--, 1);
                            } else if (p[0] == 1) {
                                foundEnd = true;
                                if (point[0] == 1 && p != point) points.splice(i--, 1);
                            }
                        }
                        if (!foundStart) points.push([0, start]);
                        if (!foundEnd) points.push([1, end]);
                    }
function fixCurves() {
                        if (point[0] == 0) start = point[1];
                        if (point[0] == 1) end = point[1];
                        var points = filter[curves.name];
                        var foundStart = false;
                        var foundEnd = false;
                        for (var i = 0; i < points.length; i++) {
                            var p = points[i];
                            if (p[0] == 0) {
                                foundStart = true;
                                if (point[0] == 0 && p != point) points.splice(i--, 1);
                            } else if (p[0] == 1) {
                                foundEnd = true;
                                if (point[0] == 1 && p != point) points.splice(i--, 1);
                            }
                        }
                        if (!foundStart) points.push([0, start]);
                        if (!foundEnd) points.push([1, end]);
                    }
function fixCurves ( ) { if ( point [ 0 ] == 0 ) start = point [ 1 ] ; if ( point [ 0 ] == 1 ) end = point [ 1 ] ; var points = filter [ curves . name ] ; var foundStart = false ; var foundEnd = false ; for ( var i = 0 ; i < points . length ; i ++ ) { var p = points [ i ] ; if ( p [ 0 ] == 0 ) { foundStart = true ; if ( point [ 0 ] == 0 && p != point ) points . splice ( i -- , 1 ) ; } else if ( p [ 0 ] == 1 ) { foundEnd = true ; if ( point [ 0 ] == 1 && p != point ) points . splice ( i -- , 1 ) ; } } if ( ! foundStart ) points . push ( [ 0 , start ] ) ; if ( ! foundEnd ) points . push ( [ 1 , end ] ) ; }
Make sure there's always a start and end node
Make sure there s always a start and end node