aboutsummaryrefslogtreecommitdiff
path: root/js/controllers/elements
diff options
context:
space:
mode:
Diffstat (limited to 'js/controllers/elements')
-rwxr-xr-xjs/controllers/elements/shapes-controller.js23
1 files changed, 16 insertions, 7 deletions
diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js
index b6d97b14..d72d9c14 100755
--- a/js/controllers/elements/shapes-controller.js
+++ b/js/controllers/elements/shapes-controller.js
@@ -261,28 +261,37 @@ exports.ShapesController = Montage.create(CanvasController, {
261 261
262 _setGradientMaterial: { 262 _setGradientMaterial: {
263 value: function(el, gradientMode, isFill) { 263 value: function(el, gradientMode, isFill) {
264 var m = "LinearGradientMaterial"; 264 var m = "LinearGradientMaterial",
265 fm;
265 if(gradientMode === "radial") 266 if(gradientMode === "radial")
266 { 267 {
267 m = "RadialGradientMaterial"; 268 m = "RadialGradientMaterial";
268 } 269 }
269 270
270 if(el.elementModel.shapeModel.fillMaterial.getName() !== m) 271 if(isFill)
271 { 272 {
272 var fm = Object.create(MaterialsModel.getMaterial(m)); 273 if(el.elementModel.shapeModel.fillMaterial.getName() !== m)
273 if(fm)
274 { 274 {
275 if(isFill) 275 fm = Object.create(MaterialsModel.getMaterial(m));
276 if(fm)
276 { 277 {
277 el.elementModel.shapeModel.GLGeomObj.setFillMaterial(fm); 278 el.elementModel.shapeModel.GLGeomObj.setFillMaterial(fm);
278 el.elementModel.shapeModel.fillMaterial = fm; 279 el.elementModel.shapeModel.fillMaterial = fm;
280 el.elementModel.shapeModel.GLGeomObj.buildBuffers();
279 } 281 }
280 else 282 }
283 }
284 else
285 {
286 if(el.elementModel.shapeModel.strokeMaterial.getName() !== m)
287 {
288 fm = Object.create(MaterialsModel.getMaterial(m));
289 if(fm)
281 { 290 {
282 el.elementModel.shapeModel.GLGeomObj.setStrokeMaterial(fm); 291 el.elementModel.shapeModel.GLGeomObj.setStrokeMaterial(fm);
283 el.elementModel.shapeModel.strokeMaterial = fm; 292 el.elementModel.shapeModel.strokeMaterial = fm;
293 el.elementModel.shapeModel.GLGeomObj.buildBuffers();
284 } 294 }
285 el.elementModel.shapeModel.GLGeomObj.buildBuffers();
286 } 295 }
287 } 296 }
288 } 297 }