aboutsummaryrefslogtreecommitdiff
path: root/js/tools
diff options
context:
space:
mode:
authorPushkar Joshi2012-03-27 15:40:37 -0700
committerPushkar Joshi2012-03-27 15:40:37 -0700
commit3fd098981077e40841c013a8ac305036d08a215b (patch)
treed8b52ee21ef7d9eb4a2d53e831bd526d4f4e0809 /js/tools
parent02a34df0ec3201199d209d43f621898b5607c150 (diff)
downloadninja-3fd098981077e40841c013a8ac305036d08a215b.tar.gz
added cursors to the pen tool UI AND change cursor when the user hovers over an anchor point or handles of thte selected anchor
Diffstat (limited to 'js/tools')
-rwxr-xr-xjs/tools/PenTool.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/js/tools/PenTool.js b/js/tools/PenTool.js
index 779b7f16..39a1b15a 100755
--- a/js/tools/PenTool.js
+++ b/js/tools/PenTool.js
@@ -348,16 +348,17 @@ exports.PenTool = Montage.create(ShapeTool, {
348 348
349 var currMousePos = this._getUnsnappedPosition(event.pageX, event.pageY); 349 var currMousePos = this._getUnsnappedPosition(event.pageX, event.pageY);
350 if (currMousePos && this._selectedSubpath ){ 350 if (currMousePos && this._selectedSubpath ){
351 var selAnchor = this._selectedSubpath.pickAnchor(currMousePos[0], currMousePos[1], currMousePos[2], this._PICK_POINT_RADIUS); 351 var selAnchorRetCode = this._selectedSubpath.pickAnchor(currMousePos[0], currMousePos[1], currMousePos[2], this._PICK_POINT_RADIUS);
352 if (selAnchor >=0) { 352 if (selAnchorRetCode[0] >=0) {
353 this._hoveredAnchorIndex = selAnchor; 353 this._hoveredAnchorIndex = selAnchorRetCode[0];
354 var cursor = "url('images/cursors/penCursors/Pen_anchorSelect.png') 0 0, default";
355 this.application.ninja.stage.drawingCanvas.style.cursor = cursor;
354 } else { 356 } else {
355 //detect if the current mouse position will hit the path 357 //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); 358 var pathHitTestData = this._selectedSubpath.pathHitTest(currMousePos[0], currMousePos[1], currMousePos[2], this._PICK_POINT_RADIUS);
357 if (pathHitTestData[0]!==-1){ 359 if (pathHitTestData[0]!==-1){
358 //change the cursor 360 //change the cursor
359 var cursor = "url('images/cursors/penAdd.png') 10 10,default"; 361
360 this.application.ninja.stage.drawingCanvas.style.cursor = cursor;
361 } 362 }
362 } 363 }
363 } 364 }