aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Bornand <nicolas74@gmail.com>2014-05-11 11:11:03 +0200
committerNicolas Bornand <nicolas74@gmail.com>2014-05-11 11:11:03 +0200
commitec3c9d46a0440cf1ecefcd04368cd69e43d9f4cd (patch)
treea84d5874ec35e60b8d0a9d498655b9b407f32883
parent2d0c4c0f9e8b1b7ae1bbcac7357b615710e51f8c (diff)
parent5f28557fb021fbdb3d916c2cc5d1ae2170b30118 (diff)
downloadplayGraph-ec3c9d46a0440cf1ecefcd04368cd69e43d9f4cd.tar.gz
playGraph-ec3c9d46a0440cf1ecefcd04368cd69e43d9f4cd.tar.bz2
playGraph-ec3c9d46a0440cf1ecefcd04368cd69e43d9f4cd.zip
Merge origin/master
-rw-r--r--app/css/app.css7
-rw-r--r--app/js/directives.js6
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++)
{