diff options
-rw-r--r-- | app/index.html | 2 | ||||
-rw-r--r-- | app/js/app.js | 56 | ||||
-rw-r--r-- | app/js/directives.js | 10 |
3 files changed, 65 insertions, 3 deletions
diff --git a/app/index.html b/app/index.html index 905840a..1b15a7e 100644 --- a/app/index.html +++ b/app/index.html @@ -42,7 +42,7 @@ <fieldset> <legend>TrackList :</legend> <ul> - <li data-ng-repeat="song in playseq | filter:{selected:true}">{{song.label}}</li> + <li data-ng-repeat="song in playseq">{{song.label}}</li> </ul> </fieldset> diff --git a/app/js/app.js b/app/js/app.js index 504311b..514f187 100644 --- a/app/js/app.js +++ b/app/js/app.js @@ -97,8 +97,62 @@ var dummyPoints= [ x: 420, y: 490, label:"piste f" + }, + { + x: 700, + y: 750, + label:"just beat it" + }, + { + x: 650, + y: 730, + label:"piste f" + }, + { + x: 900, + y: 850, + label:"piste f" + }, + { + x: 800, + y: 600, + label:"piste f" + }, + { + x: 850, + y: 610, + label:"piste f" + }, + { + x: 640, + y: 880, + label:"piste f" + }, + { + x: 900, + y: 350, + label:"piste f" + }, + { + x: 800, + y: 200, + label:"piste f" + }, + { + x: 950, + y: 300, + label:"piste f" + }, + { + x: 740, + y: 120, + label:"piste f" + }, + { + x: 900, + y: 320, + label:"piste f" } - ] var Song = function(point){ diff --git a/app/js/directives.js b/app/js/directives.js index 2895592..428fad1 100644 --- a/app/js/directives.js +++ b/app/js/directives.js @@ -53,7 +53,9 @@ app.directive('pgLine', function () { var points = Array(); // When the mouse is released, simplify it: - path.simplify(10); + path.simplify(1); + path.smooth(1); + for(var i=0; i<path._segments.length; i++) { @@ -64,14 +66,20 @@ app.directive('pgLine', function () { scope.$apply(); } + var lines = []; scope.$watch('list', function(newPoints) { console.log("update"); + angular.forEach(lines, function(line) { + line.remove(); + }); if (newPoints) { + for (var i = 0; i < newPoints.length - 1; ++i) { if (newPoints[i].selected) { var line = paper.Path.Line(newPoints[i], newPoints[i+1]); line.strokeColor = 'rgba(7,140,255,.6)'; line.strokeWidth = 2; + lines.push(line) } } } |