diff options
Diffstat (limited to 'js/tools')
-rw-r--r-- | js/tools/FillTool.js | 20 | ||||
-rw-r--r-- | js/tools/LineTool.js | 4 | ||||
-rw-r--r-- | js/tools/OvalTool.js | 8 | ||||
-rw-r--r-- | js/tools/RectTool.js | 8 |
4 files changed, 37 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..a0d5a182 100644 --- a/js/tools/LineTool.js +++ b/js/tools/LineTool.js | |||
@@ -225,6 +225,10 @@ exports.LineTool = Montage.create(ShapeTool, { | |||
225 | canvas.elementModel.pi = "LinePi"; | 225 | canvas.elementModel.pi = "LinePi"; |
226 | canvas.elementModel.shapeModel.strokeSize = this.options.strokeSize.value + " " + this.options.strokeSize.units; | 226 | canvas.elementModel.shapeModel.strokeSize = this.options.strokeSize.value + " " + this.options.strokeSize.units; |
227 | canvas.elementModel.shapeModel.stroke = strokeColor; | 227 | canvas.elementModel.shapeModel.stroke = strokeColor; |
228 | if(strokeColor) | ||
229 | { | ||
230 | canvas.elementModel.shapeModel.border = this.application.ninja.colorController.colorToolbar.stroke; | ||
231 | } | ||
228 | 232 | ||
229 | canvas.elementModel.shapeModel.strokeMaterial = strokeMaterial; | 233 | canvas.elementModel.shapeModel.strokeMaterial = strokeMaterial; |
230 | canvas.elementModel.shapeModel.strokeMaterialIndex = strokeIndex; | 234 | 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; |