diff options
author | Nivesh Rajbhandari | 2012-03-27 11:33:28 -0700 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-03-27 11:33:28 -0700 |
commit | 5d055d9fd20a2f4e5078bd722513ce905e9a6146 (patch) | |
tree | b643c7fb00e9456f34f1309225a9da1dcf059690 | |
parent | 2d94104653667e93e0f7e5f8d12bc4f7b82e64fa (diff) | |
download | ninja-5d055d9fd20a2f4e5078bd722513ce905e9a6146.tar.gz |
Check for webGLWorld before calling draw.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
-rwxr-xr-x | js/tools/EyedropperTool.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/js/tools/EyedropperTool.js b/js/tools/EyedropperTool.js index 7458a9e8..d627f03b 100755 --- a/js/tools/EyedropperTool.js +++ b/js/tools/EyedropperTool.js | |||
@@ -395,9 +395,12 @@ exports.EyedropperTool = Montage.create(toolBase, { | |||
395 | this._webGlWorld.importJSON(worldData); | 395 | this._webGlWorld.importJSON(worldData); |
396 | this._webGlWorld.render(); | 396 | this._webGlWorld.render(); |
397 | setTimeout(function() { | 397 | setTimeout(function() { |
398 | this._webGlWorld.draw(); | 398 | if(this._webGlWorld) |
399 | this._imageDataContext.drawImage(this._webGlDataCanvas, 0, 0); | 399 | { |
400 | return this._getColorFromCanvas(this._imageDataContext, tmpPt, true); | 400 | this._webGlWorld.draw(); |
401 | this._imageDataContext.drawImage(this._webGlDataCanvas, 0, 0); | ||
402 | return this._getColorFromCanvas(this._imageDataContext, tmpPt, true); | ||
403 | } | ||
401 | }.bind(this), 250); | 404 | }.bind(this), 250); |
402 | } | 405 | } |
403 | } | 406 | } |