From f840698f6841353c83ed0a9225e741e59df5fb29 Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Sun, 11 May 2014 12:53:24 +0200 Subject: remove ability to move timeline --- app/css/app.css | 2 +- app/js/directives.js | 45 +++++++++++++++------------------------------ 2 files changed, 16 insertions(+), 31 deletions(-) diff --git a/app/css/app.css b/app/css/app.css index 1b32625..1b79d29 100644 --- a/app/css/app.css +++ b/app/css/app.css @@ -7,7 +7,7 @@ .world { position: relative; - overflow: hidden; + border: solid #999999 1px; } .world .line { diff --git a/app/js/directives.js b/app/js/directives.js index 2ae53e6..3004ebd 100644 --- a/app/js/directives.js +++ b/app/js/directives.js @@ -16,45 +16,30 @@ app.directive('pgLine', function () { paper.setup(canvas); var path; - var selected = null; var drag = false; mainTool.onMouseDown = function(event) { - var hit = paper.project.hitTest(event.point) - if (hit) { - selected = hit.item; - } else { - paper.project.clear(); - // If we produced a path before, deselect it: - if (path) { - - path.selected = false; - } - - // Create a new path and set its stroke color to black: - path = new paper.Path({ - segments: [event.point], - strokeColor: 'rgba(7,140,255,.5)', - strokeWidth: 100, - fullySelected: true, - strokeCap: 'round' - }); - selected = null; - }; - + paper.project.clear(); + // If we produced a path before, deselect it: + if (path) { + path.selected = false; + } + // Create a new path and set its stroke color to black: + path = new paper.Path({ + segments: [event.point], + strokeColor: 'rgba(7,140,255,.5)', + strokeWidth: 100, + fullySelected: true, + strokeCap: 'round' + }); + drag = true; }; mainTool.onMouseMove = function(event) { - console.log(event.point); if (drag) { - if (selected) { - selected.position = event.point; - scope.$apply(); - } else { - path.add(event.point); - } + path.add(event.point); } } -- cgit v1.2.3