diff options
author | Nivesh Rajbhandari | 2012-03-09 08:21:13 -0800 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-03-09 08:27:44 -0800 |
commit | 86784888a98a05523dbedcbe32fd4dea336878e7 (patch) | |
tree | ba7e4f5a06172186031c5d82c8575dd1f8196c20 /js/lib/drawing | |
parent | d9552dbac17fa7e12dd26f05ebe14172aaa32483 (diff) | |
download | ninja-86784888a98a05523dbedcbe32fd4dea336878e7.tar.gz |
Eyedropper support for getting color value from webgl shapes.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js/lib/drawing')
-rwxr-xr-x | js/lib/drawing/world.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/js/lib/drawing/world.js b/js/lib/drawing/world.js index 3d6c6fc4..04e4d96b 100755 --- a/js/lib/drawing/world.js +++ b/js/lib/drawing/world.js | |||
@@ -26,7 +26,7 @@ var MaterialsModel = require("js/models/materials-model").MaterialsModel; | |||
26 | // Class GLWorld | 26 | // Class GLWorld |
27 | // Manages display in a canvas | 27 | // Manages display in a canvas |
28 | /////////////////////////////////////////////////////////////////////// | 28 | /////////////////////////////////////////////////////////////////////// |
29 | var World = function GLWorld( canvas, use3D ) { | 29 | var World = function GLWorld( canvas, use3D, preserveDrawingBuffer ) { |
30 | /////////////////////////////////////////////////////////////////////// | 30 | /////////////////////////////////////////////////////////////////////// |
31 | // Instance variables | 31 | // Instance variables |
32 | /////////////////////////////////////////////////////////////////////// | 32 | /////////////////////////////////////////////////////////////////////// |
@@ -39,7 +39,11 @@ var World = function GLWorld( canvas, use3D ) { | |||
39 | 39 | ||
40 | this._canvas = canvas; | 40 | this._canvas = canvas; |
41 | if (this._useWebGL) { | 41 | if (this._useWebGL) { |
42 | this._glContext = canvas.getContext("experimental-webgl"); | 42 | if(preserveDrawingBuffer) { |
43 | this._glContext = canvas.getContext("experimental-webgl", {preserveDrawingBuffer: true}); | ||
44 | } else { | ||
45 | this._glContext = canvas.getContext("experimental-webgl"); | ||
46 | } | ||
43 | } else { | 47 | } else { |
44 | this._2DContext = canvas.getContext( "2d" ); | 48 | this._2DContext = canvas.getContext( "2d" ); |
45 | } | 49 | } |
@@ -680,7 +684,7 @@ World.prototype.render = function() { | |||
680 | var root = this.getGeomRoot(); | 684 | var root = this.getGeomRoot(); |
681 | this.hRender( root ); | 685 | this.hRender( root ); |
682 | } else { | 686 | } else { |
683 | g_Engine.setContext( this._canvas.rdgeId ); | 687 | g_Engine.setContext( this._canvas.rdgeid ); |
684 | //this.draw(); | 688 | //this.draw(); |
685 | this.restartRenderLoop(); | 689 | this.restartRenderLoop(); |
686 | } | 690 | } |