aboutsummaryrefslogtreecommitdiff
path: root/js/tools/EyedropperTool.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/tools/EyedropperTool.js')
-rwxr-xr-xjs/tools/EyedropperTool.js13
1 files changed, 11 insertions, 2 deletions
diff --git a/js/tools/EyedropperTool.js b/js/tools/EyedropperTool.js
index 927b86cf..6d6937e3 100755
--- a/js/tools/EyedropperTool.js
+++ b/js/tools/EyedropperTool.js
@@ -368,7 +368,7 @@ exports.EyedropperTool = Montage.create(toolBase, {
368 this._imageDataContext = this._imageDataCanvas.getContext("2d"); 368 this._imageDataContext = this._imageDataCanvas.getContext("2d");
369 if(isWebGl) 369 if(isWebGl)
370 { 370 {
371 var worldData = elt.elementModel.shapeModel.GLWorld.export(); 371 var worldData = elt.elementModel.shapeModel.GLWorld.exportJSON();
372 if(worldData) 372 if(worldData)
373 { 373 {
374 this._webGlDataCanvas = njModule.NJUtils.makeNJElement("canvas", "Canvas", "shape", {"data-RDGE-id": njModule.NJUtils.generateRandom()}, true); 374 this._webGlDataCanvas = njModule.NJUtils.makeNJElement("canvas", "Canvas", "shape", {"data-RDGE-id": njModule.NJUtils.generateRandom()}, true);
@@ -379,7 +379,16 @@ exports.EyedropperTool = Montage.create(toolBase, {
379 this._webGlDataCanvas.width = w; 379 this._webGlDataCanvas.width = w;
380 this._webGlDataCanvas.height = h; 380 this._webGlDataCanvas.height = h;
381 this._webGlWorld = new World(this._webGlDataCanvas, true, true); 381 this._webGlWorld = new World(this._webGlDataCanvas, true, true);
382 this._webGlWorld.import(worldData); 382
383 var index = worldData.indexOf( ';' );
384 if ((worldData[0] === 'v') && (index < 24))
385 {
386 // JSON format. separate the version info from the JSON info
387 var jStr = worldData.substr( index+1 );
388 worldData = JSON.parse( jStr );
389 }
390
391 this._webGlWorld.importJSON(worldData);
383 this._webGlWorld.render(); 392 this._webGlWorld.render();
384 setTimeout(function() { 393 setTimeout(function() {
385 this._webGlWorld.draw(); 394 this._webGlWorld.draw();