mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[libgdx] Ignore clipping attachments with too few vertices.
Needed for editor, check not necessary for other runtimes.
This commit is contained in:
parent
58a5c8c2f0
commit
c5907b6714
@ -305,10 +305,8 @@ public class SkeletonRenderer {
|
|||||||
float oldScaleY = rootBone.getScaleY();
|
float oldScaleY = rootBone.getScaleY();
|
||||||
float oldRotation = rootBone.getRotation();
|
float oldRotation = rootBone.getRotation();
|
||||||
attachmentSkeleton.setPosition(bone.getWorldX(), bone.getWorldY());
|
attachmentSkeleton.setPosition(bone.getWorldX(), bone.getWorldY());
|
||||||
// rootBone.setScaleX(1 + bone.getWorldScaleX() -
|
// rootBone.setScaleX(1 + bone.getWorldScaleX() - oldScaleX);
|
||||||
// oldScaleX);
|
// rootBone.setScaleY(1 + bone.getWorldScaleY() - oldScaleY);
|
||||||
// rootBone.setScaleY(1 + bone.getWorldScaleY() -
|
|
||||||
// oldScaleY);
|
|
||||||
// Also set shear.
|
// Also set shear.
|
||||||
rootBone.setRotation(oldRotation + bone.getWorldRotationX());
|
rootBone.setRotation(oldRotation + bone.getWorldRotationX());
|
||||||
attachmentSkeleton.updateWorldTransform();
|
attachmentSkeleton.updateWorldTransform();
|
||||||
|
|||||||
@ -49,9 +49,10 @@ public class SkeletonClipping {
|
|||||||
|
|
||||||
public int clipStart (Slot slot, ClippingAttachment clip) {
|
public int clipStart (Slot slot, ClippingAttachment clip) {
|
||||||
if (clipAttachment != null) return 0;
|
if (clipAttachment != null) return 0;
|
||||||
|
int n = clip.getWorldVerticesLength();
|
||||||
|
if (n < 6) return 0;
|
||||||
clipAttachment = clip;
|
clipAttachment = clip;
|
||||||
|
|
||||||
int n = clip.getWorldVerticesLength();
|
|
||||||
float[] vertices = clippingPolygon.setSize(n);
|
float[] vertices = clippingPolygon.setSize(n);
|
||||||
clip.computeWorldVertices(slot, 0, n, vertices, 0, 2);
|
clip.computeWorldVertices(slot, 0, n, vertices, 0, 2);
|
||||||
makeClockwise(clippingPolygon);
|
makeClockwise(clippingPolygon);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user