diff options
Diffstat (limited to 'js/controllers')
-rw-r--r-- | js/controllers/elements/shapes-controller.js | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js index 44723a1e..640119c4 100644 --- a/js/controllers/elements/shapes-controller.js +++ b/js/controllers/elements/shapes-controller.js | |||
@@ -351,12 +351,17 @@ exports.ShapesController = Montage.create(CanvasController, { | |||
351 | el.elementModel.shapeModel.GLGeomObj = world.getGeomRoot(); | 351 | el.elementModel.shapeModel.GLGeomObj = world.getGeomRoot(); |
352 | 352 | ||
353 | sm = Object.create(MaterialsLibrary.getMaterial("FlatMaterial")); | 353 | sm = Object.create(MaterialsLibrary.getMaterial("FlatMaterial")); |
354 | fm = Object.create(MaterialsLibrary.getMaterial("FlatMaterial")); | 354 | if(sm) |
355 | if(sm && fm) | ||
356 | { | 355 | { |
357 | el.elementModel.shapeModel.GLGeomObj.setStrokeMaterial(sm); | 356 | el.elementModel.shapeModel.GLGeomObj.setStrokeMaterial(sm); |
358 | el.elementModel.shapeModel.GLGeomObj.setFillMaterial(fm); | ||
359 | el.elementModel.shapeModel.strokeMaterial = sm; | 357 | el.elementModel.shapeModel.strokeMaterial = sm; |
358 | } | ||
359 | fm = Object.create(MaterialsLibrary.getMaterial("FlatMaterial")); | ||
360 | // TODO - Use consts after GL code is converted to object literal notation | ||
361 | // if( fm && (el.elementModel.shapeModel.GLGeomObj.geomType() !== GLGeomObj.GEOM_TYPE_LINE) ) | ||
362 | if( fm && (el.elementModel.shapeModel.GLGeomObj.geomType() !== 3) ) | ||
363 | { | ||
364 | el.elementModel.shapeModel.GLGeomObj.setFillMaterial(fm); | ||
360 | el.elementModel.shapeModel.fillMaterial = fm; | 365 | el.elementModel.shapeModel.fillMaterial = fm; |
361 | } | 366 | } |
362 | } | 367 | } |
@@ -381,9 +386,13 @@ exports.ShapesController = Montage.create(CanvasController, { | |||
381 | world.import(worldData); | 386 | world.import(worldData); |
382 | el.elementModel.shapeModel.GLGeomObj = world.getGeomRoot(); | 387 | el.elementModel.shapeModel.GLGeomObj = world.getGeomRoot(); |
383 | el.elementModel.shapeModel.GLGeomObj.setStrokeMaterial(null); | 388 | el.elementModel.shapeModel.GLGeomObj.setStrokeMaterial(null); |
384 | el.elementModel.shapeModel.GLGeomObj.setFillMaterial(null); | ||
385 | el.elementModel.shapeModel.strokeMaterial = null; | 389 | el.elementModel.shapeModel.strokeMaterial = null; |
386 | el.elementModel.shapeModel.fillMaterial = null; | 390 | // TODO - Use consts after GL code is converted to object literal notation |
391 | if(el.elementModel.shapeModel.GLGeomObj.geomType() !== 3) | ||
392 | { | ||
393 | el.elementModel.shapeModel.GLGeomObj.setFillMaterial(null); | ||
394 | el.elementModel.shapeModel.fillMaterial = null; | ||
395 | } | ||
387 | } | 396 | } |
388 | } | 397 | } |
389 | } | 398 | } |