aboutsummaryrefslogtreecommitdiff
path: root/js/controllers
diff options
context:
space:
mode:
authorJohn Mayhew2012-02-10 16:20:45 -0800
committerJohn Mayhew2012-02-10 16:20:45 -0800
commiteb0032234971f2c1c471f562d52c086fcffe8a14 (patch)
tree9fe9a49b5b49c3c0d15ea4fc124df4c100ffb730 /js/controllers
parent730c1e191e36b8ab8dba576c481a6585e0dfa69e (diff)
parent344933fd505afb9f5dfa3be8cc959112df04da0a (diff)
downloadninja-eb0032234971f2c1c471f562d52c086fcffe8a14.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into WorkingBranch
Diffstat (limited to 'js/controllers')
-rw-r--r--js/controllers/elements/shapes-controller.js29
1 files changed, 19 insertions, 10 deletions
diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js
index b9c033aa..640119c4 100644
--- a/js/controllers/elements/shapes-controller.js
+++ b/js/controllers/elements/shapes-controller.js
@@ -346,19 +346,24 @@ exports.ShapesController = Montage.create(CanvasController, {
346 { 346 {
347 world = new GLWorld(el, true); 347 world = new GLWorld(el, true);
348 el.elementModel.shapeModel.GLWorld = world; 348 el.elementModel.shapeModel.GLWorld = world;
349 el.elementModel.shapeModel.GLGeomObj.setWorld(world);
350 el.elementModel.shapeModel.useWebGl = true; 349 el.elementModel.shapeModel.useWebGl = true;
350 world.import(worldData);
351 el.elementModel.shapeModel.GLGeomObj = world.getGeomRoot();
352
351 sm = Object.create(MaterialsLibrary.getMaterial("FlatMaterial")); 353 sm = Object.create(MaterialsLibrary.getMaterial("FlatMaterial"));
352 fm = Object.create(MaterialsLibrary.getMaterial("FlatMaterial")); 354 if(sm)
353 if(sm && fm)
354 { 355 {
355 el.elementModel.shapeModel.GLGeomObj.setStrokeMaterial(sm); 356 el.elementModel.shapeModel.GLGeomObj.setStrokeMaterial(sm);
356 el.elementModel.shapeModel.GLGeomObj.setFillMaterial(fm);
357 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);
358 el.elementModel.shapeModel.fillMaterial = fm; 365 el.elementModel.shapeModel.fillMaterial = fm;
359 el.elementModel.shapeModel.GLGeomObj.buildBuffers();
360 } 366 }
361 world.import(worldData);
362 } 367 }
363 368
364 } 369 }
@@ -378,13 +383,17 @@ exports.ShapesController = Montage.create(CanvasController, {
378 world = new GLWorld(el, false); 383 world = new GLWorld(el, false);
379 el.elementModel.shapeModel.GLWorld = world; 384 el.elementModel.shapeModel.GLWorld = world;
380 el.elementModel.shapeModel.useWebGl = false; 385 el.elementModel.shapeModel.useWebGl = false;
386 world.import(worldData);
387 el.elementModel.shapeModel.GLGeomObj = world.getGeomRoot();
381 el.elementModel.shapeModel.GLGeomObj.setStrokeMaterial(null); 388 el.elementModel.shapeModel.GLGeomObj.setStrokeMaterial(null);
382 el.elementModel.shapeModel.GLGeomObj.setFillMaterial(null);
383 el.elementModel.shapeModel.strokeMaterial = null; 389 el.elementModel.shapeModel.strokeMaterial = null;
384 el.elementModel.shapeModel.fillMaterial = null; 390 // TODO - Use consts after GL code is converted to object literal notation
385 world.import(worldData); 391 if(el.elementModel.shapeModel.GLGeomObj.geomType() !== 3)
392 {
393 el.elementModel.shapeModel.GLGeomObj.setFillMaterial(null);
394 el.elementModel.shapeModel.fillMaterial = null;
395 }
386 } 396 }
387
388 } 397 }
389 } 398 }
390 399