aboutsummaryrefslogtreecommitdiff
path: root/js/tools
diff options
context:
space:
mode:
Diffstat (limited to 'js/tools')
-rw-r--r--js/tools/BrushTool.js2
-rwxr-xr-xjs/tools/LineTool.js6
-rwxr-xr-xjs/tools/OvalTool.js4
-rwxr-xr-xjs/tools/PenTool.js4
-rwxr-xr-xjs/tools/PencilTool.js32
-rwxr-xr-xjs/tools/RectTool.js4
6 files changed, 10 insertions, 42 deletions
diff --git a/js/tools/BrushTool.js b/js/tools/BrushTool.js
index 5c334b92..0be378fd 100644
--- a/js/tools/BrushTool.js
+++ b/js/tools/BrushTool.js
@@ -132,7 +132,7 @@ exports.BrushTool = Montage.create(ShapeTool, {
132 if (this._selectedBrushStroke === null){ 132 if (this._selectedBrushStroke === null){
133 this._selectedBrushStroke = new BrushStroke(); 133 this._selectedBrushStroke = new BrushStroke();
134 var colorArray=[0,0,0,0]; 134 var colorArray=[0,0,0,0];
135 var color = this.application.ninja.colorController.colorToolbar.fill.color; 135 var color = this.options.fill.color;
136 if (color){ 136 if (color){
137 colorArray = [color.r/255, color.g/255, color.b/255, color.a]; 137 colorArray = [color.r/255, color.g/255, color.b/255, color.a];
138 } else { 138 } else {
diff --git a/js/tools/LineTool.js b/js/tools/LineTool.js
index 5941b464..9160e220 100755
--- a/js/tools/LineTool.js
+++ b/js/tools/LineTool.js
@@ -44,8 +44,8 @@ exports.LineTool = Montage.create(ShapeTool, {
44 } 44 }
45 45
46 this._strokeSize = ShapesController.GetValueInPixels(this.options.strokeSize.value, this.options.strokeSize.units, null); 46 this._strokeSize = ShapesController.GetValueInPixels(this.options.strokeSize.value, this.options.strokeSize.units, null);
47 if (this.application.ninja.colorController.colorToolbar.stroke.color) 47 if (this.options.stroke.color)
48 this._strokeColor = this.application.ninja.colorController.colorToolbar.stroke.color.css; 48 this._strokeColor = this.options.stroke.color.css;
49 else 49 else
50 this._strokeColor = [0,0,0,1]; 50 this._strokeColor = [0,0,0,1];
51 this.startDraw(event); 51 this.startDraw(event);
@@ -215,7 +215,7 @@ exports.LineTool = Montage.create(ShapeTool, {
215 var left = Math.round(midPt[0] - 0.5*w); 215 var left = Math.round(midPt[0] - 0.5*w);
216 var top = Math.round(midPt[1] - 0.5*h); 216 var top = Math.round(midPt[1] - 0.5*h);
217 217
218 var strokeColor = this.application.ninja.colorController.colorToolbar.stroke.webGlColor; 218 var strokeColor = this.options.stroke.webGlColor;
219 // for default stroke and fill/no materials 219 // for default stroke and fill/no materials
220 var strokeMaterial = null; 220 var strokeMaterial = null;
221 221
diff --git a/js/tools/OvalTool.js b/js/tools/OvalTool.js
index 6edec811..f1da3a46 100755
--- a/js/tools/OvalTool.js
+++ b/js/tools/OvalTool.js
@@ -39,8 +39,8 @@ exports.OvalTool = Montage.create(ShapeTool, {
39 39
40 var innerRadius = this.options.innerRadius.value / 100; 40 var innerRadius = this.options.innerRadius.value / 100;
41 41
42 var strokeColor = this.application.ninja.colorController.colorToolbar.stroke.webGlColor; 42 var strokeColor = this.options.stroke.webGlColor;
43 var fillColor = this.application.ninja.colorController.colorToolbar.fill.webGlColor; 43 var fillColor = this.options.fill.webGlColor;
44 44
45 // for default stroke and fill/no materials 45 // for default stroke and fill/no materials
46 var strokeMaterial = null; 46 var strokeMaterial = null;
diff --git a/js/tools/PenTool.js b/js/tools/PenTool.js
index 16990ca7..e70bed27 100755
--- a/js/tools/PenTool.js
+++ b/js/tools/PenTool.js
@@ -240,7 +240,7 @@ exports.PenTool = Montage.create(ShapeTool, {
240 this._selectedSubpath.setStrokeWidth(strokeSize); 240 this._selectedSubpath.setStrokeWidth(strokeSize);
241 241
242 var colorArray=[]; 242 var colorArray=[];
243 var color = this.application.ninja.colorController.colorToolbar.stroke.color; 243 var color = this.options.stroke.color;
244 if (color){ 244 if (color){
245 colorArray = [color.r/255, color.g/255, color.b/255, color.a]; 245 colorArray = [color.r/255, color.g/255, color.b/255, color.a];
246 }else { 246 }else {
@@ -248,7 +248,7 @@ exports.PenTool = Montage.create(ShapeTool, {
248 } 248 }
249 this._selectedSubpath.setStrokeColor(colorArray); 249 this._selectedSubpath.setStrokeColor(colorArray);
250 250
251 color = this.application.ninja.colorController.colorToolbar.fill.color; 251 color = this.options.fill.color;
252 if (color){ 252 if (color){
253 colorArray = [color.r/255, color.g/255, color.b/255, color.a]; 253 colorArray = [color.r/255, color.g/255, color.b/255, color.a];
254 } else { 254 } else {
diff --git a/js/tools/PencilTool.js b/js/tools/PencilTool.js
deleted file mode 100755
index 349eb1e8..00000000
--- a/js/tools/PencilTool.js
+++ /dev/null
@@ -1,32 +0,0 @@
1/* <copyright>
2This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
4(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5</copyright> */
6
7var Montage = require("montage/core/core").Montage,
8 DrawingTool = require("js/tools/drawing-tool").DrawingTool;
9
10exports.PencilTool = Montage.create(DrawingTool, {
11 drawingFeedback: { value: { mode: "Draw2D", type: "" } },
12
13 HandleLeftButtonDown: {
14 value: function(event) {
15 NJevent("enableStageMove");
16
17 }
18 },
19
20 HandleMouseMove: {
21 value: function(event) {
22 this.doDraw(event);
23 }
24 },
25
26 HandleLeftButtonUp: {
27 value: function(event) {
28 this.endDraw(event);
29 NJevent("disableStageMove");
30 }
31 }
32}); \ No newline at end of file
diff --git a/js/tools/RectTool.js b/js/tools/RectTool.js
index 0c14a559..d4951db8 100755
--- a/js/tools/RectTool.js
+++ b/js/tools/RectTool.js
@@ -59,8 +59,8 @@ exports.RectTool = Montage.create(ShapeTool, {
59 var blRadius = ShapesController.GetValueInPixels(this.options.BLRadiusControl.value, this.options.BLRadiusControl.units, h); 59 var blRadius = ShapesController.GetValueInPixels(this.options.BLRadiusControl.value, this.options.BLRadiusControl.units, h);
60 var brRadius = ShapesController.GetValueInPixels(this.options.BRRadiusControl.value, this.options.BRRadiusControl.units, h); 60 var brRadius = ShapesController.GetValueInPixels(this.options.BRRadiusControl.value, this.options.BRRadiusControl.units, h);
61 61
62 var strokeColor = this.application.ninja.colorController.colorToolbar.stroke.webGlColor; 62 var strokeColor = this.options.stroke.webGlColor;
63 var fillColor = this.application.ninja.colorController.colorToolbar.fill.webGlColor; 63 var fillColor = this.options.fill.webGlColor;
64 // for default stroke and fill/no materials 64 // for default stroke and fill/no materials
65 var strokeMaterial = null; 65 var strokeMaterial = null;
66 var fillMaterial = null; 66 var fillMaterial = null;