Skip to content

Commit bc844a7

Browse files
authored
Merge pull request #15062 from WestLangley/dev-line_clone_copy
Line: fix copy and clone methods
2 parents 49cd315 + a99eac6 commit bc844a7

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/objects/Line.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,20 @@ Line.prototype = Object.assign( Object.create( Object3D.prototype ), {
244244

245245
}() ),
246246

247+
copy: function ( source ) {
248+
249+
Object3D.prototype.copy.call( this, source );
250+
251+
this.geometry.copy( source.geometry );
252+
this.material.copy( source.material );
253+
254+
return this;
255+
256+
},
257+
247258
clone: function () {
248259

249-
return new this.constructor( this.geometry, this.material ).copy( this );
260+
return new this.constructor().copy( this );
250261

251262
}
252263

0 commit comments

Comments
 (0)