From b9493ccbf3e13c4edd2749bf3eedf6d2b002cd21 Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Sun, 11 May 2014 11:10:16 +0200 Subject: smooth instead of simplify --- app/css/app.css | 7 +++++++ app/js/directives.js | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/css/app.css b/app/css/app.css index 5f3e698..d0abf83 100644 --- a/app/css/app.css +++ b/app/css/app.css @@ -1,7 +1,14 @@ /* app css stylesheet */ +* { + margin: 0; + padding: 0; +} + .world { position: relative; + background-color: lightyellow; + overflow: hidden; } .world .line { diff --git a/app/js/directives.js b/app/js/directives.js index a460d93..4bdd45b 100644 --- a/app/js/directives.js +++ b/app/js/directives.js @@ -4,10 +4,11 @@ app.directive('pgLine', function () { return { restrict: 'A', replace: 'false', - template: '', + template: '', link: function (scope, elems, attrs) { var canvas = elems[0]; var mainTool = new paper.Tool(); + mainTool.activate(); scope.line = scope.$eval(attrs.pgLine); @@ -18,6 +19,7 @@ app.directive('pgLine', function () { var selected = null; var drag = false; + mainTool.onMouseDown = function(event) { var hit = paper.project.hitTest(event.point) if (hit) { @@ -61,7 +63,7 @@ app.directive('pgLine', function () { var points = Array(); // When the mouse is released, simplify it: - path.simplify(10); + path.smooth(); for(var i=0; i