diff options
-rwxr-xr-x | js/controllers/elements/shapes-controller.js | 4 | ||||
-rwxr-xr-x | js/lib/drawing/world.js | 9 |
2 files changed, 8 insertions, 5 deletions
diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js index b3ac9ddb..9b0159d4 100755 --- a/js/controllers/elements/shapes-controller.js +++ b/js/controllers/elements/shapes-controller.js | |||
@@ -495,7 +495,7 @@ exports.ShapesController = Montage.create(CanvasController, { | |||
495 | world = new World(el, true); | 495 | world = new World(el, true); |
496 | el.elementModel.shapeModel.GLWorld = world; | 496 | el.elementModel.shapeModel.GLWorld = world; |
497 | el.elementModel.shapeModel.useWebGl = true; | 497 | el.elementModel.shapeModel.useWebGl = true; |
498 | world.import(worldData); | 498 | world.import(worldData, true); |
499 | el.elementModel.shapeModel.GLGeomObj = world.getGeomRoot(); | 499 | el.elementModel.shapeModel.GLGeomObj = world.getGeomRoot(); |
500 | 500 | ||
501 | sm = Object.create(MaterialsModel.getMaterial("FlatMaterial")); | 501 | sm = Object.create(MaterialsModel.getMaterial("FlatMaterial")); |
@@ -531,7 +531,7 @@ exports.ShapesController = Montage.create(CanvasController, { | |||
531 | world = new World(el, false); | 531 | world = new World(el, false); |
532 | el.elementModel.shapeModel.GLWorld = world; | 532 | el.elementModel.shapeModel.GLWorld = world; |
533 | el.elementModel.shapeModel.useWebGl = false; | 533 | el.elementModel.shapeModel.useWebGl = false; |
534 | world.import(worldData); | 534 | world.import(worldData, true); |
535 | el.elementModel.shapeModel.GLGeomObj = world.getGeomRoot(); | 535 | el.elementModel.shapeModel.GLGeomObj = world.getGeomRoot(); |
536 | el.elementModel.shapeModel.GLGeomObj.setStrokeMaterial(null); | 536 | el.elementModel.shapeModel.GLGeomObj.setStrokeMaterial(null); |
537 | el.elementModel.shapeModel.strokeMaterial = null; | 537 | el.elementModel.shapeModel.strokeMaterial = null; |
diff --git a/js/lib/drawing/world.js b/js/lib/drawing/world.js index 049145ce..c1ee0cd0 100755 --- a/js/lib/drawing/world.js +++ b/js/lib/drawing/world.js | |||
@@ -810,14 +810,17 @@ World.prototype.findTransformNodeByMaterial = function( materialNode, trNode ) | |||
810 | return rtnNode; | 810 | return rtnNode; |
811 | }; | 811 | }; |
812 | 812 | ||
813 | World.prototype.import = function( importStr ) { | 813 | World.prototype.import = function( importStr, fromToggle ) { |
814 | // import the worldattributes - not currently used | 814 | // import the worldattributes - not currently used |
815 | 815 | ||
816 | // determine if the data was written for export (no Ninja objects) | 816 | // determine if the data was written for export (no Ninja objects) |
817 | // or for save/restore | 817 | // or for save/restore |
818 | //var index = importStr.indexOf( "scenedata: " ); | 818 | //var index = importStr.indexOf( "scenedata: " ); |
819 | var index = importStr.indexOf( "webGL: " ); | 819 | // Skip if we are toggling between canvas2d and WebGL since importStr doesn't have the correct webGL value yet |
820 | this._useWebGL = (index >= 0) | 820 | if(!fromToggle) { |
821 | var index = importStr.indexOf( "webGL: " ); | ||
822 | this._useWebGL = (index >= 0) | ||
823 | } | ||
821 | if (this._useWebGL) | 824 | if (this._useWebGL) |
822 | { | 825 | { |
823 | // start RDGE | 826 | // start RDGE |