aboutsummaryrefslogtreecommitdiff
path: root/js/tools
diff options
context:
space:
mode:
authorPushkar Joshi2012-03-06 17:24:16 -0800
committerPushkar Joshi2012-03-06 17:24:16 -0800
commitc9284b3f1876e2954a8d6330dc0ae0b6630a358b (patch)
tree02d4bd57a77bbe43b8d8f0670b0a6d32a107fc52 /js/tools
parent7a43958033906b2273de88bc2a26cda7a905d202 (diff)
parent40f3fc5feae866c99af818a886e8bf9d8cf2b8dd (diff)
downloadninja-c9284b3f1876e2954a8d6330dc0ae0b6630a358b.tar.gz
Merge branch 'pentool' into brushtool
Diffstat (limited to 'js/tools')
-rwxr-xr-xjs/tools/PenTool.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/js/tools/PenTool.js b/js/tools/PenTool.js
index 71a91870..6897c003 100755
--- a/js/tools/PenTool.js
+++ b/js/tools/PenTool.js
@@ -278,6 +278,9 @@ exports.PenTool = Montage.create(ShapeTool, {
278 this.application.ninja.stage.clearDrawingCanvas(); 278 this.application.ninja.stage.clearDrawingCanvas();
279 this._hoveredAnchorIndex = -1; 279 this._hoveredAnchorIndex = -1;
280 280
281 //set the cursor to be the default cursor
282 this.application.ninja.stage.drawingCanvas.style.cursor = "auto";
283
281 if (this._isDrawing) { 284 if (this._isDrawing) {
282 var point = webkitConvertPointFromPageToNode(this.application.ninja.stage.canvas, new WebKitPoint(event.pageX, event.pageY)); 285 var point = webkitConvertPointFromPageToNode(this.application.ninja.stage.canvas, new WebKitPoint(event.pageX, event.pageY));
283 //go through the drawing toolbase to get the position of the mouse 286 //go through the drawing toolbase to get the position of the mouse
@@ -348,6 +351,14 @@ exports.PenTool = Montage.create(ShapeTool, {
348 var selAnchor = this._selectedSubpath.pickAnchor(currMousePos[0], currMousePos[1], currMousePos[2], this._PICK_POINT_RADIUS); 351 var selAnchor = this._selectedSubpath.pickAnchor(currMousePos[0], currMousePos[1], currMousePos[2], this._PICK_POINT_RADIUS);
349 if (selAnchor >=0) { 352 if (selAnchor >=0) {
350 this._hoveredAnchorIndex = selAnchor; 353 this._hoveredAnchorIndex = selAnchor;
354 } else {
355 //detect if the current mouse position will hit the path
356 var pathHitTestData = this._selectedSubpath.pathHitTest(currMousePos[0], currMousePos[1], currMousePos[2], this._PICK_POINT_RADIUS);
357 if (pathHitTestData[0]!==-1){
358 //change the cursor
359 var cursor = "url('images/cursors/penAdd.png') 10 10,default";
360 this.application.ninja.stage.drawingCanvas.style.cursor = cursor;
361 }
351 } 362 }
352 } 363 }
353 } //else of if (this._isDrawing) { 364 } //else of if (this._isDrawing) {
@@ -356,7 +367,6 @@ exports.PenTool = Montage.create(ShapeTool, {
356 if (this._selectedSubpath){ 367 if (this._selectedSubpath){
357 this.DrawSubpathAnchors(this._selectedSubpath); 368 this.DrawSubpathAnchors(this._selectedSubpath);
358 } 369 }
359
360 }//value: function(event) 370 }//value: function(event)
361 },//HandleMouseMove 371 },//HandleMouseMove
362 372