diff options
author | Jakob Odersky <jodersky@gmail.com> | 2014-05-11 11:10:16 +0200 |
---|---|---|
committer | Jakob Odersky <jodersky@gmail.com> | 2014-05-11 11:10:16 +0200 |
commit | b9493ccbf3e13c4edd2749bf3eedf6d2b002cd21 (patch) | |
tree | 7bb1a4151a4ab9d4ce43c14dcd5d45542eab3389 | |
parent | 9e579f32a7818f78f568089638fdcf8a06f579e6 (diff) | |
download | playGraph-b9493ccbf3e13c4edd2749bf3eedf6d2b002cd21.tar.gz playGraph-b9493ccbf3e13c4edd2749bf3eedf6d2b002cd21.tar.bz2 playGraph-b9493ccbf3e13c4edd2749bf3eedf6d2b002cd21.zip |
smooth instead of simplify
-rw-r--r-- | app/css/app.css | 7 | ||||
-rw-r--r-- | 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: '<canvas resize></canvas>', + template: '<canvas width=100%; height: 100%></canvas>', 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<path._segments.length; i++) { |