mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-06 18:56:54 +08:00
[libgdx] SkeletonRendererDebug draws direction for zero length bones.
This commit is contained in:
parent
bc629cec11
commit
81a4e3ea1d
@ -82,14 +82,20 @@ public class SkeletonRendererDebug {
|
|||||||
|
|
||||||
Array<Bone> bones = skeleton.getBones();
|
Array<Bone> bones = skeleton.getBones();
|
||||||
if (drawBones) {
|
if (drawBones) {
|
||||||
shapes.setColor(boneLineColor);
|
|
||||||
shapes.begin(ShapeType.Filled);
|
shapes.begin(ShapeType.Filled);
|
||||||
for (int i = 0, n = bones.size; i < n; i++) {
|
for (int i = 0, n = bones.size; i < n; i++) {
|
||||||
Bone bone = bones.get(i);
|
Bone bone = bones.get(i);
|
||||||
if (bone.parent == null) continue;
|
if (bone.parent == null) continue;
|
||||||
float x = skeletonX + bone.data.length * bone.a + bone.worldX;
|
float length = bone.data.length, width = boneWidth;
|
||||||
float y = skeletonY + bone.data.length * bone.c + bone.worldY;
|
if (length == 0) {
|
||||||
shapes.rectLine(skeletonX + bone.worldX, skeletonY + bone.worldY, x, y, boneWidth * scale);
|
length = 8;
|
||||||
|
width /= 2;
|
||||||
|
shapes.setColor(boneOriginColor);
|
||||||
|
} else
|
||||||
|
shapes.setColor(boneLineColor);
|
||||||
|
float x = skeletonX + length * bone.a + bone.worldX;
|
||||||
|
float y = skeletonY + length * bone.c + bone.worldY;
|
||||||
|
shapes.rectLine(skeletonX + bone.worldX, skeletonY + bone.worldY, x, y, width * scale);
|
||||||
}
|
}
|
||||||
shapes.end();
|
shapes.end();
|
||||||
shapes.begin(ShapeType.Line);
|
shapes.begin(ShapeType.Line);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user