From 49eba848c3006045c6096d21fd8262c9d98a35d8 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Tue, 20 Mar 2012 13:47:03 -0700 Subject: IKNINJA-1370 - Toggle WebGL on/off is no longer working in the PI. This bug was injected by some changes in GLWorld.import. Signed-off-by: Nivesh Rajbhandari --- js/lib/drawing/world.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'js/lib') 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 ) return rtnNode; }; -World.prototype.import = function( importStr ) { +World.prototype.import = function( importStr, fromToggle ) { // import the worldattributes - not currently used // determine if the data was written for export (no Ninja objects) // or for save/restore //var index = importStr.indexOf( "scenedata: " ); - var index = importStr.indexOf( "webGL: " ); - this._useWebGL = (index >= 0) + // Skip if we are toggling between canvas2d and WebGL since importStr doesn't have the correct webGL value yet + if(!fromToggle) { + var index = importStr.indexOf( "webGL: " ); + this._useWebGL = (index >= 0) + } if (this._useWebGL) { // start RDGE -- cgit v1.2.3