mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-05 06:44:56 +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();
|
||||
if (drawBones) {
|
||||
shapes.setColor(boneLineColor);
|
||||
shapes.begin(ShapeType.Filled);
|
||||
for (int i = 0, n = bones.size; i < n; i++) {
|
||||
Bone bone = bones.get(i);
|
||||
if (bone.parent == null) continue;
|
||||
float x = skeletonX + bone.data.length * bone.a + bone.worldX;
|
||||
float y = skeletonY + bone.data.length * bone.c + bone.worldY;
|
||||
shapes.rectLine(skeletonX + bone.worldX, skeletonY + bone.worldY, x, y, boneWidth * scale);
|
||||
float length = bone.data.length, width = boneWidth;
|
||||
if (length == 0) {
|
||||
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.begin(ShapeType.Line);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user