瀏覽代碼

[libgdx] Fix copy constructor of region and mesh attachments

Only copy sequence if != null.
Mario Zechner 3 年之前
父節點
當前提交
c7b54dc9b3

+ 1 - 1
spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/MeshAttachment.java

@@ -80,7 +80,7 @@ public class MeshAttachment extends VertexAttachment implements HasTextureRegion
 		arraycopy(other.triangles, 0, triangles, 0, triangles.length);
 
 		hullLength = other.hullLength;
-		sequence = new Sequence(sequence);
+		sequence = sequence != null ? new Sequence(sequence) : null;
 
 		// Nonessential.
 		if (other.edges != null) {

+ 1 - 1
spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/RegionAttachment.java

@@ -75,7 +75,7 @@ public class RegionAttachment extends Attachment implements HasTextureRegion {
 		arraycopy(other.uvs, 0, uvs, 0, 8);
 		arraycopy(other.offset, 0, offset, 0, 8);
 		color.set(other.color);
-		sequence = new Sequence(sequence);
+		sequence = sequence != null ? new Sequence(sequence) : null;
 	}
 
 	/** Calculates the {@link #offset} and {@link #uvs} using the region and the attachment's transform. Must be called if the