Pārlūkot izejas kodu

Curves: Init arrays before deserialize

Mugen87 7 gadi atpakaļ
vecāks
revīzija
ae80431cae

+ 1 - 0
src/extras/core/CurvePath.js

@@ -242,6 +242,7 @@ CurvePath.prototype = Object.assign( Object.create( Curve.prototype ), {
 		Curve.prototype.fromJSON.call( this, json );
 
 		this.autoClose = json.autoClose;
+		this.curves = [];
 
 		for ( var i = 0, l = json.curves.length; i < l; i ++ ) {
 

+ 2 - 0
src/extras/core/Shape.js

@@ -91,6 +91,8 @@ Shape.prototype = Object.assign( Object.create( Path.prototype ), {
 
 		Path.prototype.fromJSON.call( this, json );
 
+		this.holes = [];
+
 		for ( var i = 0, l = json.holes.length; i < l; i ++ ) {
 
 			var hole = json.holes[ i ];

+ 2 - 0
src/extras/curves/CatmullRomCurve3.js

@@ -234,6 +234,8 @@ CatmullRomCurve3.prototype.fromJSON = function ( json ) {
 
 	Curve.prototype.fromJSON.call( this, json );
 
+	this.points = [];
+
 	for ( var i = 0, l = json.points.length; i < l; i ++ ) {
 
 		var point = json.points[ i ];

+ 2 - 0
src/extras/curves/SplineCurve.js

@@ -81,6 +81,8 @@ SplineCurve.prototype.fromJSON = function ( json ) {
 
 	Curve.prototype.fromJSON.call( this, json );
 
+	this.points = [];
+
 	for ( var i = 0, l = json.points.length; i < l; i ++ ) {
 
 		var point = json.points[ i ];