diff options
Diffstat (limited to 'js/lib/geom/geom-obj.js')
-rwxr-xr-x | js/lib/geom/geom-obj.js | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/js/lib/geom/geom-obj.js b/js/lib/geom/geom-obj.js index 3a7a5619..66f557dd 100755 --- a/js/lib/geom/geom-obj.js +++ b/js/lib/geom/geom-obj.js | |||
@@ -191,27 +191,10 @@ exports.GeomObj = Object.create(Object.prototype, { | |||
191 | nMats = this._materialArray.length; | 191 | nMats = this._materialArray.length; |
192 | } | 192 | } |
193 | 193 | ||
194 | var stops = [], | 194 | if (nMats === this._materialTypeArray.length) { |
195 | colors = c.color; | 195 | for (i = 0; i < nMats; i++) { |
196 | 196 | if (this._materialTypeArray[i] == type) { | |
197 | var len = colors.length; | 197 | this._materialArray[i].setGradientData(c.color); |
198 | // TODO - Current shaders only support 4 color stops | ||
199 | if (len > 4) { | ||
200 | len = 4; | ||
201 | } | ||
202 | |||
203 | for (var n = 0; n < len; n++) { | ||
204 | var position = colors[n].position / 100; | ||
205 | var cs = colors[n].value; | ||
206 | var stop = [cs.r / 255, cs.g / 255, cs.b / 255, cs.a]; | ||
207 | stops.push(stop); | ||
208 | |||
209 | if (nMats === this._materialTypeArray.length) { | ||
210 | for (i = 0; i < nMats; i++) { | ||
211 | if (this._materialTypeArray[i] == type) { | ||
212 | this._materialArray[i].setProperty("color" + (n + 1), stop.slice(0)); | ||
213 | this._materialArray[i].setProperty("colorStop" + (n + 1), position); | ||
214 | } | ||
215 | } | 198 | } |
216 | } | 199 | } |
217 | } | 200 | } |