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.js6
1 files changed, 4 insertions, 2 deletions
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++)
{