diff options
author | Jose Antonio Marquez | 2012-02-09 15:02:51 -0800 |
---|---|---|
committer | Jose Antonio Marquez | 2012-02-09 15:02:51 -0800 |
commit | 67a5b6a1fb352bdc69ff05297268c27e7e2ba795 (patch) | |
tree | 8483701ec4d16143a2517b82a8148a7c5a456b0c /js/tools/modifier-tool-base.js | |
parent | 74efc1238f51e9c0ffdeffe2a349f66011ef9f17 (diff) | |
parent | 666ae3e9119410cbf7fa974274d95336aaff091c (diff) | |
download | ninja-67a5b6a1fb352bdc69ff05297268c27e7e2ba795.tar.gz |
Merge branch 'refs/heads/NinjaInternal' into FileIO
Diffstat (limited to 'js/tools/modifier-tool-base.js')
-rwxr-xr-x | js/tools/modifier-tool-base.js | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/js/tools/modifier-tool-base.js b/js/tools/modifier-tool-base.js index f78e99c8..67b217c4 100755 --- a/js/tools/modifier-tool-base.js +++ b/js/tools/modifier-tool-base.js | |||
@@ -437,16 +437,19 @@ exports.ModifierToolBase = Montage.create(DrawingTool, { | |||
437 | 437 | ||
438 | startDraw: { | 438 | startDraw: { |
439 | value: function(event) { | 439 | value: function(event) { |
440 | this.isDrawing = true; | 440 | if(this._target) |
441 | this.application.ninja.stage.showSelectionBounds = false; | ||
442 | |||
443 | if(this._canSnap) | ||
444 | { | ||
445 | this.initializeSnapping(event); | ||
446 | } | ||
447 | else | ||
448 | { | 441 | { |
449 | this.drawWithoutSnapping(event); | 442 | this.isDrawing = true; |
443 | this.application.ninja.stage.showSelectionBounds = false; | ||
444 | |||
445 | if(this._canSnap) | ||
446 | { | ||
447 | this.initializeSnapping(event); | ||
448 | } | ||
449 | else | ||
450 | { | ||
451 | this.drawWithoutSnapping(event); | ||
452 | } | ||
450 | } | 453 | } |
451 | } | 454 | } |
452 | }, | 455 | }, |
@@ -674,11 +677,15 @@ exports.ModifierToolBase = Montage.create(DrawingTool, { | |||
674 | return this._targets; | 677 | return this._targets; |
675 | }, | 678 | }, |
676 | set: function (value) { | 679 | set: function (value) { |
677 | this._target = value; | 680 | this._targets = value; |
678 | if (value === null) | 681 | if (value !== null && value.length) |
679 | { | 682 | { |
680 | return; | 683 | this.target = value[0]; |
681 | } | 684 | } |
685 | else | ||
686 | { | ||
687 | this.target = null; | ||
688 | } | ||
682 | } | 689 | } |
683 | }, | 690 | }, |
684 | 691 | ||
@@ -723,7 +730,7 @@ exports.ModifierToolBase = Montage.create(DrawingTool, { | |||
723 | } else { | 730 | } else { |
724 | this.eventManager.removeEventListener("selectionChange", this, true); | 731 | this.eventManager.removeEventListener("selectionChange", this, true); |
725 | this.application.ninja.stage._iframeContainer.removeEventListener("scroll", this, false); | 732 | this.application.ninja.stage._iframeContainer.removeEventListener("scroll", this, false); |
726 | this._targets = null; | 733 | this._targets = []; |
727 | 734 | ||
728 | // Clean up | 735 | // Clean up |
729 | NJevent("disableStageMove"); | 736 | NJevent("disableStageMove"); |
@@ -749,7 +756,7 @@ exports.ModifierToolBase = Montage.create(DrawingTool, { | |||
749 | 756 | ||
750 | captureSelectionDrawn: { | 757 | captureSelectionDrawn: { |
751 | value: function(event){ | 758 | value: function(event){ |
752 | this._targets = null; | 759 | this._targets = []; |
753 | 760 | ||
754 | var len = this.application.ninja.selectedElements.length; | 761 | var len = this.application.ninja.selectedElements.length; |
755 | if(len) | 762 | if(len) |