Browse Source

Fix canvas.toDataURL yielding blank image.

rasmusvhansen 9 years ago
parent
commit
3c11c2407c
1 changed files with 2 additions and 1 deletions
  1. 2 1
      jsmpg.js

+ 2 - 1
jsmpg.js View File

928
 
928
 
929
 	// attempt to get a webgl context
929
 	// attempt to get a webgl context
930
 	try {
930
 	try {
931
-		gl = this.gl = this.canvas.getContext('webgl') || this.canvas.getContext('experimental-webgl');
931
+		var options = { preserveDrawingBuffer: true };
932
+		gl = this.gl = this.canvas.getContext('webgl', options) || this.canvas.getContext('experimental-webgl', options);
932
 	} catch (e) {
933
 	} catch (e) {
933
 		return false;
934
 		return false;
934
 	}
935
 	}