瀏覽代碼

ColladaExporter: Fix runtime error when processing ImageBitmap.

Mugen87 5 年之前
父節點
當前提交
a036bdb353
共有 2 個文件被更改,包括 4 次插入4 次删除
  1. 2 2
      examples/js/exporters/ColladaExporter.js
  2. 2 2
      examples/jsm/exporters/ColladaExporter.js

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

@@ -100,8 +100,8 @@ THREE.ColladaExporter.prototype = {
 			canvas = canvas || document.createElement( 'canvas' );
 			canvas = canvas || document.createElement( 'canvas' );
 			ctx = ctx || canvas.getContext( '2d' );
 			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 );
 			ctx.drawImage( image, 0, 0 );
 
 

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

@@ -109,8 +109,8 @@ ColladaExporter.prototype = {
 			canvas = canvas || document.createElement( 'canvas' );
 			canvas = canvas || document.createElement( 'canvas' );
 			ctx = ctx || canvas.getContext( '2d' );
 			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 );
 			ctx.drawImage( image, 0, 0 );