Browse Source

Merge pull request #20049 from Mugen87/dev51

ColladaExporter: Fix runtime error when processing ImageBitmap.
Mr.doob 5 years ago
parent
commit
0ff40ec576

+ 2 - 2
examples/js/exporters/ColladaExporter.js

@@ -100,8 +100,8 @@ THREE.ColladaExporter.prototype = {
 			canvas = canvas || document.createElement( 'canvas' );
 			ctx = ctx || canvas.getContext( '2d' );
 
-			canvas.width = image.naturalWidth;
-			canvas.height = image.naturalHeight;
+			canvas.width = image.width;
+			canvas.height = image.height;
 
 			ctx.drawImage( image, 0, 0 );
 

+ 2 - 2
examples/jsm/exporters/ColladaExporter.js

@@ -109,8 +109,8 @@ ColladaExporter.prototype = {
 			canvas = canvas || document.createElement( 'canvas' );
 			ctx = ctx || canvas.getContext( '2d' );
 
-			canvas.width = image.naturalWidth;
-			canvas.height = image.naturalHeight;
+			canvas.width = image.width;
+			canvas.height = image.height;
 
 			ctx.drawImage( image, 0, 0 );