aboutsummaryrefslogtreecommitdiff
path: root/js/tools/FillTool.js
diff options
context:
space:
mode:
authorArmen Kesablyan2012-06-11 11:04:29 -0700
committerArmen Kesablyan2012-06-11 11:04:29 -0700
commit0f040acabfb7a4bf3138debec5aff869487ceb11 (patch)
tree53eaa8ba54cf23a1c3ea0c8b39377773198c3e19 /js/tools/FillTool.js
parent7d3bdf39e6d1534de1848ca2744aed66dfeb5d2a (diff)
parent756cbfad2b98b300af8db3793aa21718b88dd950 (diff)
downloadninja-0f040acabfb7a4bf3138debec5aff869487ceb11.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal
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 }