Skip to content

Commit d31df14

Browse files
authored
Line2NodeMaterial: Fix clone() losing worldUnits, dashed, and linewidth (#33236)
1 parent 2f89c1e commit d31df14

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

src/materials/nodes/Line2NodeMaterial.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,33 @@ class Line2NodeMaterial extends NodeMaterial {
537537

538538
}
539539

540+
/**
541+
* Copies the properties of the given material to this instance.
542+
*
543+
* @param {Line2NodeMaterial} source - The material to copy.
544+
* @return {Line2NodeMaterial} A reference to this material.
545+
*/
546+
copy( source ) {
547+
548+
super.copy( source );
549+
550+
this.vertexColors = source.vertexColors;
551+
this.dashOffset = source.dashOffset;
552+
553+
this.lineColorNode = source.lineColorNode;
554+
this.offsetNode = source.offsetNode;
555+
this.dashScaleNode = source.dashScaleNode;
556+
this.dashSizeNode = source.dashSizeNode;
557+
this.gapSizeNode = source.gapSizeNode;
558+
559+
this._useDash = source._useDash;
560+
this._useAlphaToCoverage = source._useAlphaToCoverage;
561+
this._useWorldUnits = source._useWorldUnits;
562+
563+
return this;
564+
565+
}
566+
540567
}
541568

542569
export default Line2NodeMaterial;

0 commit comments

Comments
 (0)