aboutsummaryrefslogtreecommitdiff
path: root/app/js/directives.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/js/directives.js')
-rw-r--r--app/js/directives.js10
1 files changed, 9 insertions, 1 deletions
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)
}
}
}