aboutsummaryrefslogtreecommitdiff
path: root/js/tools/FillTool.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/FillTool.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/FillTool.js')
-rwxr-xr-xjs/tools/FillTool.js33
1 files changed, 20 insertions, 13 deletions
diff --git a/js/tools/FillTool.js b/js/tools/FillTool.js
index 66dd9305..e08ec1da 100755
--- a/js/tools/FillTool.js
+++ b/js/tools/FillTool.js
@@ -70,25 +70,32 @@ exports.FillTool = Montage.create(ModifierToolBase, {
70 // Called by modifier tool base's HandleLeftButtonDown after updating selection (if needed) 70 // Called by modifier tool base's HandleLeftButtonDown after updating selection (if needed)
71 startDraw: { 71 startDraw: {
72 value: function(event) { 72 value: function(event) {
73 this.drawData = null;
73 this.isDrawing = true; 74 this.isDrawing = true;
74 75
75 if(this._canColor && this.application.ninja.selectedElements.length) { 76 if(this._canColor && this.application.ninja.selectedElements.length) {
77 var fillInfo = {},
78 color;
79 if(this.options.useFillColor.checked) {
80 fillInfo.colorInfo = {};
81 color = this.options.fill;
82 if(color && color.color)
83 {
84 fillInfo.colorInfo.mode = color.colorMode;
85 fillInfo.colorInfo.color = color.color;
86 } else {
87 fillInfo.colorInfo.mode = "nocolor";
88 fillInfo.colorInfo.color = null;
89 }
90 }
76 91
77 var color = this.options.fill, 92 if(this.options.useWebGL.checked) {
78 colorInfo; 93 fillInfo.webGLInfo = {};
79 if(color && color.color) 94 fillInfo.webGLInfo.material = this.options.fillMaterial.value;
80 {
81 colorInfo = { mode:color.colorMode,
82 color:color.color
83 };
84 } 95 }
85 else 96 if(fillInfo.colorInfo || fillInfo.webGLInfo) {
86 { 97 ElementsMediator.setFill(this.application.ninja.selectedElements, fillInfo, "Change", "fillTool");
87 colorInfo = { mode:"nocolor",
88 color:color.color
89 };
90 } 98 }
91 ElementsMediator.setColor(this.application.ninja.selectedElements, colorInfo, true, "Change", "fillTool");
92 } 99 }
93 } 100 }
94 } 101 }