Skip to content

Commit ce1a1f1

Browse files
committed
Revert change of passing in arguments to constructor
I forgot that `copy` is possibly used elsewhere, and that it also needs to copy those parameters.
1 parent a1d1494 commit ce1a1f1

2 files changed

Lines changed: 21 additions & 4 deletions

File tree

src/textures/CubeTexture.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@ THREE.CubeTexture = function ( images, mapping, wrapS, wrapT, magFilter, minFilt
1616
THREE.CubeTexture.prototype = Object.create( THREE.Texture.prototype );
1717
THREE.CubeTexture.prototype.constructor = THREE.CubeTexture;
1818

19-
THREE.CubeTexture.prototype.clone = function () {
19+
THREE.CubeTexture.prototype.copy = function ( source ) {
2020

21-
var texture = new this.constructor( this.images, this.mapping, this.wrapS, this.wrapT, this.magFilter, this.minFilter, this.format, this.type, this.anisotropy );
22-
return texture.copy( this );
21+
THREE.Texture.prototype.copy.call( this, source );
22+
23+
this.images = source.images;
24+
25+
return this;
2326

2427
};

src/textures/Texture.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,28 @@ THREE.Texture.prototype = {
5757

5858
clone: function () {
5959

60-
var texture = new this.constructor( this.image, this.mapping, this.wrapS, this.wrapT, this.magFilter, this.minFilter, this.format, this.type, this.anisotropy );
60+
var texture = new this.constructor();
6161
return texture.copy( this );
6262

6363
},
6464

6565
copy: function ( source ) {
6666

67+
this.image = source.image;
6768
this.mipmaps = source.mipmaps.slice( 0 );
69+
70+
this.mapping = source.mapping;
71+
72+
this.wrapS = source.wrapS;
73+
this.wrapT = source.wrapT;
74+
75+
this.magFilter = source.magFilter;
76+
this.minFilter = source.minFilter;
77+
78+
this.anisotropy = source.anisotropy;
79+
80+
this.format = source.format;
81+
this.type = source.type;
6882

6983
this.offset.copy( source.offset );
7084
this.repeat.copy( source.repeat );

0 commit comments

Comments
 (0)