aboutsummaryrefslogtreecommitdiff
path: root/js/tools
diff options
context:
space:
mode:
Diffstat (limited to 'js/tools')
-rw-r--r--js/tools/FillTool.js20
-rw-r--r--js/tools/LineTool.js5
-rw-r--r--js/tools/OvalTool.js8
-rw-r--r--js/tools/RectTool.js8
-rw-r--r--js/tools/ShapeTool.js1
5 files changed, 39 insertions, 3 deletions
diff --git a/js/tools/FillTool.js b/js/tools/FillTool.js
index 477966da..fabcec69 100644
--- a/js/tools/FillTool.js
+++ b/js/tools/FillTool.js
@@ -54,10 +54,24 @@ exports.FillTool = Montage.create(ModifierToolBase, {
54 value: function(event) { 54 value: function(event) {
55 this.isDrawing = true; 55 this.isDrawing = true;
56 56
57 if(this._canColor) 57 if(this._canColor && this.application.ninja.selectedElements.length)
58 { 58 {
59 var color = this.application.ninja.colorController.colorToolbar.fill; 59 var color = this.application.ninja.colorController.colorToolbar.fill,
60 ElementsMediator.setColor(this.application.ninja.selectedElements, color, true, "Change", "fillTool"); 60 colorInfo;
61 if(color && color.color)
62 {
63 colorInfo = { mode:color.colorMode,
64 color:color.color
65 };
66 ElementsMediator.setColor(this.application.ninja.selectedElements, colorInfo, true, "Change", "fillTool");
67 }
68 else
69 {
70 colorInfo = { mode:"nocolor",
71 color:color.color
72 };
73 ElementsMediator.setColor(this.application.ninja.selectedElements, colorInfo, true, "Change", "fillTool");
74 }
61 } 75 }
62 } 76 }
63 } 77 }
diff --git a/js/tools/LineTool.js b/js/tools/LineTool.js
index 042ba0b2..17157f23 100644
--- a/js/tools/LineTool.js
+++ b/js/tools/LineTool.js
@@ -99,6 +99,7 @@ exports.LineTool = Montage.create(ShapeTool, {
99 } 99 }
100 this.RenderShape(w, h, drawData.planeMat, drawData.midPt, 100 this.RenderShape(w, h, drawData.planeMat, drawData.midPt,
101 canvas, slope, xAdj, yAdj); 101 canvas, slope, xAdj, yAdj);
102 NJevent("elementAdded", canvas);
102 } 103 }
103 104
104 this.endDraw(event); 105 this.endDraw(event);
@@ -225,6 +226,10 @@ exports.LineTool = Montage.create(ShapeTool, {
225 canvas.elementModel.pi = "LinePi"; 226 canvas.elementModel.pi = "LinePi";
226 canvas.elementModel.shapeModel.strokeSize = this.options.strokeSize.value + " " + this.options.strokeSize.units; 227 canvas.elementModel.shapeModel.strokeSize = this.options.strokeSize.value + " " + this.options.strokeSize.units;
227 canvas.elementModel.shapeModel.stroke = strokeColor; 228 canvas.elementModel.shapeModel.stroke = strokeColor;
229 if(strokeColor)
230 {
231 canvas.elementModel.shapeModel.border = this.application.ninja.colorController.colorToolbar.stroke;
232 }
228 233
229 canvas.elementModel.shapeModel.strokeMaterial = strokeMaterial; 234 canvas.elementModel.shapeModel.strokeMaterial = strokeMaterial;
230 canvas.elementModel.shapeModel.strokeMaterialIndex = strokeIndex; 235 canvas.elementModel.shapeModel.strokeMaterialIndex = strokeIndex;
diff --git a/js/tools/OvalTool.js b/js/tools/OvalTool.js
index e0f1f03f..2fa5411b 100644
--- a/js/tools/OvalTool.js
+++ b/js/tools/OvalTool.js
@@ -75,6 +75,14 @@ exports.OvalTool = Montage.create(ShapeTool, {
75 canvas.elementModel.shapeModel.strokeSize = this.options.strokeSize.value + " " + this.options.strokeSize.units; 75 canvas.elementModel.shapeModel.strokeSize = this.options.strokeSize.value + " " + this.options.strokeSize.units;
76 canvas.elementModel.shapeModel.stroke = strokeColor; 76 canvas.elementModel.shapeModel.stroke = strokeColor;
77 canvas.elementModel.shapeModel.fill = fillColor; 77 canvas.elementModel.shapeModel.fill = fillColor;
78 if(strokeColor)
79 {
80 canvas.elementModel.shapeModel.border = this.application.ninja.colorController.colorToolbar.stroke;
81 }
82 if(fillColor)
83 {
84 canvas.elementModel.shapeModel.background = this.application.ninja.colorController.colorToolbar.fill;
85 }
78 86
79 canvas.elementModel.shapeModel.innerRadius = this.options.innerRadius.value + " " + this.options.innerRadius.units; 87 canvas.elementModel.shapeModel.innerRadius = this.options.innerRadius.value + " " + this.options.innerRadius.units;
80 88
diff --git a/js/tools/RectTool.js b/js/tools/RectTool.js
index fbf1693e..94d80b53 100644
--- a/js/tools/RectTool.js
+++ b/js/tools/RectTool.js
@@ -94,6 +94,14 @@ exports.RectTool = Montage.create(ShapeTool, {
94 canvas.elementModel.shapeModel.strokeSize = this.options.strokeSize.value + " " + this.options.strokeSize.units; 94 canvas.elementModel.shapeModel.strokeSize = this.options.strokeSize.value + " " + this.options.strokeSize.units;
95 canvas.elementModel.shapeModel.stroke = strokeColor; 95 canvas.elementModel.shapeModel.stroke = strokeColor;
96 canvas.elementModel.shapeModel.fill = fillColor; 96 canvas.elementModel.shapeModel.fill = fillColor;
97 if(strokeColor)
98 {
99 canvas.elementModel.shapeModel.border = this.application.ninja.colorController.colorToolbar.stroke;
100 }
101 if(fillColor)
102 {
103 canvas.elementModel.shapeModel.background = this.application.ninja.colorController.colorToolbar.fill;
104 }
97 105
98 canvas.elementModel.shapeModel.tlRadius = this.options.TLRadiusControl.value + " " + this.options.TLRadiusControl.units; 106 canvas.elementModel.shapeModel.tlRadius = this.options.TLRadiusControl.value + " " + this.options.TLRadiusControl.units;
99 canvas.elementModel.shapeModel.trRadius = this.options.TRRadiusControl.value + " " + this.options.TRRadiusControl.units; 107 canvas.elementModel.shapeModel.trRadius = this.options.TRRadiusControl.value + " " + this.options.TRRadiusControl.units;
diff --git a/js/tools/ShapeTool.js b/js/tools/ShapeTool.js
index 9a4399b4..4ccb7a8d 100644
--- a/js/tools/ShapeTool.js
+++ b/js/tools/ShapeTool.js
@@ -83,6 +83,7 @@ exports.ShapeTool = Montage.create(DrawingTool, {
83 } 83 }
84 } 84 }
85 this.RenderShape(drawData.width, drawData.height, drawData.planeMat, drawData.midPt, canvas); 85 this.RenderShape(drawData.width, drawData.height, drawData.planeMat, drawData.midPt, canvas);
86 NJevent("elementAdded", canvas);
86 } 87 }
87 88
88 this.endDraw(event); 89 this.endDraw(event);