aboutsummaryrefslogtreecommitdiff
path: root/js/controllers
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-02-10 10:23:48 -0800
committerNivesh Rajbhandari2012-02-10 10:23:48 -0800
commit9e40945a5bf4330d1088b56b8011ee625b1adab9 (patch)
tree6597ec13d9c62b1097d18d04525ebe96673fcacc /js/controllers
parenta757d4d0064e0f09bb1a99651b8493514cbc4999 (diff)
downloadninja-9e40945a5bf4330d1088b56b8011ee625b1adab9.tar.gz
Support export/import of GLLine data.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js/controllers')
-rw-r--r--js/controllers/elements/shapes-controller.js19
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 }