Skip to content

Commit

Permalink
Bug fix in Three.js target plugin
Browse files Browse the repository at this point in the history
- Incorrect reference to `options.canvas` was referring to global `canvas`
- Removed unused function parameter
- renamed unused error objects to `ignore`
  • Loading branch information
brianchirls committed Dec 17, 2014
1 parent 83dd724 commit 8742296
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions targets/seriously.three.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
]),
mat4 = Seriously.util.mat4;

Seriously.target('three', function (target, options, force) {
Seriously.target('three', function (target, options) {
var me = this,
gl,
frameBuffer;
Expand All @@ -59,16 +59,16 @@
} else if (options) {
if (options.gl) {
gl = options.gl;
} else if (options.canvas) {
} else if (options.canvas && options.canvas.getContext) {
try {
gl = canvas.getContext('webgl');
} catch (expError) {
gl = options.canvas.getContext('webgl');
} catch (ignore) {
}

if (!gl) {
try {
gl = canvas.getContext('experimental-webgl');
} catch (error) {
gl = options.canvas.getContext('experimental-webgl');
} catch (ignore) {
}
}
}
Expand Down

0 comments on commit 8742296

Please sign in to comment.