From 27c1ba250a7db26cf24dd456d20af9ff1649e638 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Mon, 23 Apr 2012 17:04:48 -0700 Subject: canvas interaction --- js/lib/drawing/world.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'js/lib/drawing/world.js') diff --git a/js/lib/drawing/world.js b/js/lib/drawing/world.js index 945c9883..8ad4c6f5 100755 --- a/js/lib/drawing/world.js +++ b/js/lib/drawing/world.js @@ -362,9 +362,9 @@ var World = function GLWorld( canvas, use3D, preserveDrawingBuffer ) { // start RDGE passing your runtime object, and false to indicate we don't need a an initialization state // in the case of a procedurally built scene an init state is not needed for loading data + this._canvas.rdgeid = this._canvas.getAttribute( "data-RDGE-id" ); if (this._useWebGL) { rdgeStarted = true; - this._canvas.rdgeid = this._canvas.getAttribute( "data-RDGE-id" ); RDGE.globals.engine.unregisterCanvas( this._canvas ); RDGE.globals.engine.registerCanvas(this._canvas, this); RDGE.RDGEStart( this._canvas ); @@ -835,8 +835,11 @@ World.prototype.importJSON = function (jObj) { // import the objects // there should be exactly one child of the parent object - if (jObj.children && (jObj.children.length === 1)) - this.importObjectsJSON( jObj.children[0] ); + if (jObj.children) + { + for (var i=0; i= 1)) { this.rebuildTree(this._geomRoot); this.restartRenderLoop(); } -- cgit v1.2.3 From 7c77aa914eb96c2b5b797e37c16aa786c05f38e8 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Wed, 2 May 2012 16:50:38 -0700 Subject: Converting geom-obj to object literal notation. Signed-off-by: Nivesh Rajbhandari --- js/lib/drawing/world.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'js/lib/drawing/world.js') diff --git a/js/lib/drawing/world.js b/js/lib/drawing/world.js index 7ce23921..0dde9af4 100755 --- a/js/lib/drawing/world.js +++ b/js/lib/drawing/world.js @@ -874,17 +874,17 @@ World.prototype.importObjectJSON = function( jObj, parentGeomObj ) switch (type) { case 1: - obj = new Rectangle(); + obj = Object.create(Rectangle, {}); obj.importJSON( jObj ); break; case 2: // circle - obj = new Circle(); + obj = Object.create(Circle, {}); obj.importJSON( jObj ); break; case 3: // line - obj = new Line(); + obj = Object.create(Line, {}); obj.importJSON( jObj ); break; -- cgit v1.2.3