Explorar o código

[libgdx] Ignore clipping attachments with too few vertices.

Needed for editor, check not necessary for other runtimes.
NathanSweet %!s(int64=8) %!d(string=hai) anos
pai
achega
c5907b6714

+ 2 - 4
spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonRenderer.java

@@ -305,10 +305,8 @@ public class SkeletonRenderer {
 					float oldScaleY = rootBone.getScaleY();
 					float oldRotation = rootBone.getRotation();
 					attachmentSkeleton.setPosition(bone.getWorldX(), bone.getWorldY());
-					// rootBone.setScaleX(1 + bone.getWorldScaleX() -
-					// oldScaleX);
-					// rootBone.setScaleY(1 + bone.getWorldScaleY() -
-					// oldScaleY);
+					// rootBone.setScaleX(1 + bone.getWorldScaleX() - oldScaleX);
+					// rootBone.setScaleY(1 + bone.getWorldScaleY() - oldScaleY);
 					// Also set shear.
 					rootBone.setRotation(oldRotation + bone.getWorldRotationX());
 					attachmentSkeleton.updateWorldTransform();

+ 2 - 1
spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/utils/SkeletonClipping.java

@@ -49,9 +49,10 @@ public class SkeletonClipping {
 
 	public int clipStart (Slot slot, ClippingAttachment clip) {
 		if (clipAttachment != null) return 0;
+		int n = clip.getWorldVerticesLength();
+		if (n < 6) return 0;
 		clipAttachment = clip;
 
-		int n = clip.getWorldVerticesLength();
 		float[] vertices = clippingPolygon.setSize(n);
 		clip.computeWorldVertices(slot, 0, n, vertices, 0, 2);
 		makeClockwise(clippingPolygon);