Ensure clipping always ends.

This commit is contained in:
Nathan Sweet 2017-04-08 00:15:05 +09:00
parent 5af8185261
commit 15961df0e3
2 changed files with 8 additions and 4 deletions

View File

@ -121,7 +121,7 @@ public class SkeletonRenderer implements Disposable {
clipper.clipEnd(i);
}
clipper.clipEnd(-1);
clipper.clipEnd();
}
@SuppressWarnings("null")
@ -223,7 +223,7 @@ public class SkeletonRenderer implements Disposable {
clipper.clipEnd(i);
}
clipper.clipEnd(-1);
clipper.clipEnd();
}
@SuppressWarnings("null")
@ -332,7 +332,7 @@ public class SkeletonRenderer implements Disposable {
clipper.clipEnd(i);
}
clipper.clipEnd(-1);
clipper.clipEnd();
}
public void setPremultipliedAlpha (boolean premultipliedAlpha) {

View File

@ -64,7 +64,11 @@ public class SkeletonClipping {
}
public void clipEnd (int index) {
if (clipAttachment == null || clipAttachment.getEndSlot() != index) return;
if (clipAttachment != null && clipAttachment.getEndSlot() == index) clipEnd();
}
public void clipEnd () {
if (clipAttachment == null) return;
clipAttachment = null;
clippingPolygons = null;
clippedVertices.clear();