From 54b8039f1a014161379f776c4dcb269f4651dd19 Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Fri, 5 Jun 2020 21:28:51 +0200 Subject: [PATCH] [libgdx] Fixed a clipping bug when there are two clipping meshes and clipping-end-slot is a skin bone that is disabled (Clipping.endClipping not called when slot.bone.active==false). See #1694. --- .../esotericsoftware/spine/SkeletonRenderer.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonRenderer.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonRenderer.java index 31fbb2169..49ee9e80e 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonRenderer.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonRenderer.java @@ -91,7 +91,10 @@ public class SkeletonRenderer { Array drawOrder = skeleton.drawOrder; for (int i = 0, n = drawOrder.size; i < n; i++) { Slot slot = drawOrder.get(i); - if (!slot.bone.active) continue; + if (!slot.bone.active) { + clipper.clipEnd(slot); + continue; + } Attachment attachment = slot.attachment; if (attachment instanceof RegionAttachment) { RegionAttachment region = (RegionAttachment)attachment; @@ -170,7 +173,10 @@ public class SkeletonRenderer { Array drawOrder = skeleton.drawOrder; for (int i = 0, n = drawOrder.size; i < n; i++) { Slot slot = drawOrder.get(i); - if (!slot.bone.active) continue; + if (!slot.bone.active) { + clipper.clipEnd(slot); + continue; + } Texture texture = null; int vertexSize = clipper.isClipping() ? 2 : 5; Attachment attachment = slot.attachment; @@ -294,7 +300,10 @@ public class SkeletonRenderer { Array drawOrder = skeleton.drawOrder; for (int i = 0, n = drawOrder.size; i < n; i++) { Slot slot = drawOrder.get(i); - if (!slot.bone.active) continue; + if (!slot.bone.active) { + clipper.clipEnd(slot); + continue; + } Texture texture = null; int vertexSize = clipper.isClipping() ? 2 : 6; Attachment attachment = slot.attachment;