SkeletonDebugRenderer fix in drawBones (#1965)

skeleton.x and skeleton.y are already added in bone.worldX and
bone.worldY.
See Bone.ts => updateWorldTransformWith.
This commit is contained in:
Bastiaan 2021-10-11 15:27:08 +02:00 committed by GitHub
parent 02a85972de
commit 08dd033e51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -76,9 +76,9 @@ export class SkeletonDebugRenderer implements Disposable {
let bone = bones[i];
if (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1) continue;
if (!bone.parent) continue;
let x = skeletonX + bone.data.length * bone.a + bone.worldX;
let y = skeletonY + bone.data.length * bone.c + bone.worldY;
shapes.rectLine(true, skeletonX + bone.worldX, skeletonY + bone.worldY, x, y, this.boneWidth * this.scale);
let x = bone.data.length * bone.a + bone.worldX;
let y = bone.data.length * bone.c + bone.worldY;
shapes.rectLine(true, bone.worldX, bone.worldY, x, y, this.boneWidth * this.scale);
}
if (this.drawSkeletonXY) shapes.x(skeletonX, skeletonY, 4 * this.scale);
}
@ -195,7 +195,7 @@ export class SkeletonDebugRenderer implements Disposable {
for (let i = 0, n = bones.length; i < n; i++) {
let bone = bones[i];
if (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1) continue;
shapes.circle(true, skeletonX + bone.worldX, skeletonY + bone.worldY, 3 * this.scale, SkeletonDebugRenderer.GREEN, 8);
shapes.circle(true, bone.worldX, bone.worldY, 3 * this.scale, SkeletonDebugRenderer.GREEN, 8);
}
}