diff options
Diffstat (limited to 'js/tools')
-rwxr-xr-x | js/tools/PenTool.js | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/js/tools/PenTool.js b/js/tools/PenTool.js index cc8ec394..bbde7374 100755 --- a/js/tools/PenTool.js +++ b/js/tools/PenTool.js | |||
@@ -1468,8 +1468,8 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
1468 | } | 1468 | } |
1469 | this._isPickedEndPointInSelectPathMode = false; //only applies to the ENTRY_SELECT_PATH mode | 1469 | this._isPickedEndPointInSelectPathMode = false; //only applies to the ENTRY_SELECT_PATH mode |
1470 | 1470 | ||
1471 | this._subtool = this.SUBTOOL_NONE; | 1471 | this.handlePenSubToolChange(); |
1472 | //this.SUBTOOL_PENMINUS; | 1472 | //this._subtool = this.SUBTOOL_NONE; //this.SUBTOOL_PENMINUS; |
1473 | 1473 | ||
1474 | if (this._trackMouseMoveWhenUp){ | 1474 | if (this._trackMouseMoveWhenUp){ |
1475 | NJevent("enableStageMove"); | 1475 | NJevent("enableStageMove"); |
@@ -1477,6 +1477,7 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
1477 | this.eventManager.addEventListener("openDocument", this, false); | 1477 | this.eventManager.addEventListener("openDocument", this, false); |
1478 | this.eventManager.addEventListener("switchDocument", this, false); | 1478 | this.eventManager.addEventListener("switchDocument", this, false); |
1479 | this.eventManager.addEventListener("closeDocument", this, false); | 1479 | this.eventManager.addEventListener("closeDocument", this, false); |
1480 | this.eventManager.addEventListener("penSubToolChange", this, false); | ||
1480 | } //if the pen tool was selected | 1481 | } //if the pen tool was selected |
1481 | else { | 1482 | else { |
1482 | if (this._trackMouseMoveWhenUp){ | 1483 | if (this._trackMouseMoveWhenUp){ |
@@ -1489,10 +1490,36 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
1489 | this.eventManager.removeEventListener("openDocument", this, false); | 1490 | this.eventManager.removeEventListener("openDocument", this, false); |
1490 | this.eventManager.removeEventListener("switchDocument", this, false); | 1491 | this.eventManager.removeEventListener("switchDocument", this, false); |
1491 | this.eventManager.removeEventListener("closeDocument", this, false); | 1492 | this.eventManager.removeEventListener("closeDocument", this, false); |
1493 | this.eventManager.removeEventListener("penSubToolChange", this, false); | ||
1492 | } //if the pen tool was de-selected | 1494 | } //if the pen tool was de-selected |
1493 | } | 1495 | } |
1494 | }, | 1496 | }, |
1495 | 1497 | ||
1498 | handlePenSubToolChange: { | ||
1499 | value: function() { | ||
1500 | switch (this.options.selectedSubtool){ | ||
1501 | case "pen": | ||
1502 | this._subtool = this.SUBTOOL_NONE; | ||
1503 | console.log("Setting pen tool subtool to NONE"); | ||
1504 | break; | ||
1505 | |||
1506 | case "penPlus": | ||
1507 | console.log("Setting pen tool subtool to PLUS"); | ||
1508 | this._subtool = this.SUBTOOL_PENPLUS; | ||
1509 | break; | ||
1510 | |||
1511 | case "penMinus": | ||
1512 | console.log("Setting pen tool subtool to MINUS"); | ||
1513 | this._subtool = this.SUBTOOL_PENMINUS; | ||
1514 | break; | ||
1515 | |||
1516 | default: | ||
1517 | console.log("Setting pen tool subtool to NONE"); | ||
1518 | this._subtool = this.SUBTOOL_NONE; | ||
1519 | break; | ||
1520 | } | ||
1521 | } | ||
1522 | }, | ||
1496 | handleDelete:{ | 1523 | handleDelete:{ |
1497 | value: function(event){ | 1524 | value: function(event){ |
1498 | //clear the selected subpath...the only new additions to this function w.r.t. ToolBase | 1525 | //clear the selected subpath...the only new additions to this function w.r.t. ToolBase |