aboutsummaryrefslogtreecommitdiff
path: root/js/tools/InkBottleTool.js
diff options
context:
space:
mode:
authorArmen Kesablyan2012-06-11 11:17:41 -0700
committerArmen Kesablyan2012-06-11 11:17:41 -0700
commit278769df00ced8620fd73371e38fe2e43f07ca3b (patch)
treedeb505c8a66b660eee1f17a2c6c4c575c7939f6f /js/tools/InkBottleTool.js
parent555fd6efa605b937800b3979a4c68fa7eb8666ae (diff)
parent0f040acabfb7a4bf3138debec5aff869487ceb11 (diff)
downloadninja-278769df00ced8620fd73371e38fe2e43f07ca3b.tar.gz
Merge branch 'refs/heads/master' into binding
Conflicts: js/document/models/html.js js/document/views/design.js js/ninja.reel/ninja.js Signed-off-by: Armen Kesablyan <armen@motorola.com>
Diffstat (limited to 'js/tools/InkBottleTool.js')
-rwxr-xr-xjs/tools/InkBottleTool.js50
1 files changed, 29 insertions, 21 deletions
diff --git a/js/tools/InkBottleTool.js b/js/tools/InkBottleTool.js
index 2c03d133..c5640b10 100755
--- a/js/tools/InkBottleTool.js
+++ b/js/tools/InkBottleTool.js
@@ -65,43 +65,51 @@ exports.InkBottleTool = Montage.create(ModifierToolBase, {
65 // Called by modifier tool base's HandleLeftButtonDown after updating selection (if needed) 65 // Called by modifier tool base's HandleLeftButtonDown after updating selection (if needed)
66 startDraw: { 66 startDraw: {
67 value: function(event) { 67 value: function(event) {
68 this.drawData = null;
68 this.isDrawing = true; 69 this.isDrawing = true;
69 70
70 if(this._canColor && this.application.ninja.selectedElements.length) 71 if(this._canColor && this.application.ninja.selectedElements.length)
71 { 72 {
72 var color = this.options.stroke, 73 var strokeInfo = {},
73 colorInfo; 74 color;
74 if(color && color.color) 75 if(this.options.useStrokeColor.checked) {
75 { 76 strokeInfo.colorInfo = {};
76 colorInfo = { mode:color.colorMode, 77 color = this.options.stroke;
77 color:color.color 78 if(color && color.color)
78 }; 79 {
79 } 80 strokeInfo.colorInfo.mode = color.colorMode;
80 else 81 strokeInfo.colorInfo.color = color.color;
81 { 82 } else {
82 colorInfo = { mode:"nocolor", 83 strokeInfo.colorInfo.mode = "nocolor";
83 color:color.color 84 strokeInfo.colorInfo.color = null;
84 }; 85 }
85 } 86 }
86 87
87 if(this.options.useBorderWidth.checked || this.options.useBorderStyle.checked) { 88 if(this.options.useBorderWidth.checked || this.options.useBorderStyle.checked) {
88 colorInfo.borderInfo = {}; 89 strokeInfo.borderInfo = {};
89 if(this.options.useBorderWidth.checked) { 90 if(this.options.useBorderWidth.checked) {
90 colorInfo.borderInfo.borderWidth = this.options._borderWidth.value; 91 strokeInfo.borderInfo.borderWidth = this.options.borderWidth.value;
91 colorInfo.borderInfo.borderUnits = this.options._borderWidth.units; 92 strokeInfo.borderInfo.borderUnits = this.options.borderWidth.units;
92 } 93 }
93 if(this.options.useBorderStyle.checked) { 94 if(this.options.useBorderStyle.checked) {
94 colorInfo.borderInfo.borderStyle = this.options._borderStyle.value; 95 strokeInfo.borderInfo.borderStyle = this.options.borderStyle.value;
95 } 96 }
96 } 97 }
97 98
98 if(this.options.useStrokeSize.checked) { 99 if(this.options.useStrokeSize.checked) {
99 colorInfo.strokeInfo = {}; 100 strokeInfo.shapeInfo = {};
100 colorInfo.strokeInfo.strokeSize = this.options._strokeSize.value; 101 strokeInfo.shapeInfo.strokeSize = this.options.strokeSize.value;
101 colorInfo.strokeInfo.strokeUnits = this.options._strokeSize.units; 102 strokeInfo.shapeInfo.strokeUnits = this.options.strokeSize.units;
103 }
104
105 if(this.options.useWebGL.checked) {
106 strokeInfo.webGLInfo = {};
107 strokeInfo.webGLInfo.material = this.options.strokeMaterial.value;
102 } 108 }
103 109
104 ElementsMediator.setColor(this.application.ninja.selectedElements, colorInfo, false, "Change", "inkBottleTool"); 110 if(strokeInfo.colorInfo || strokeInfo.borderInfo || strokeInfo.shapeInfo || strokeInfo.webGLInfo) {
111 ElementsMediator.setStroke(this.application.ninja.selectedElements, strokeInfo, "Change", "inkBottleTool");
112 }
105 } 113 }
106 } 114 }
107 } 115 }