Selaa lähdekoodia

ImageBitmapLoader: Set premultiplyAlpha: premultiply by default.

Mr.doob 5 vuotta sitten
vanhempi
commit
7e5d14894e
1 muutettua tiedostoa jossa 2 lisäystä ja 11 poistoa
  1. 2 11
      src/loaders/ImageBitmapLoader.js

+ 2 - 11
src/loaders/ImageBitmapLoader.js

@@ -22,7 +22,7 @@ function ImageBitmapLoader( manager ) {
 
 	Loader.call( this, manager );
 
-	this.options = undefined;
+	this.options = { premultiplyAlpha: 'none' };
 
 }
 
@@ -72,16 +72,7 @@ ImageBitmapLoader.prototype = Object.assign( Object.create( Loader.prototype ),
 
 		} ).then( function ( blob ) {
 
-			if ( scope.options === undefined ) {
-
-				// Workaround for FireFox. It causes an error if you pass options.
-				return createImageBitmap( blob );
-
-			} else {
-
-				return createImageBitmap( blob, scope.options );
-
-			}
+			return createImageBitmap( blob, scope.options );
 
 		} ).then( function ( imageBitmap ) {