mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-10 04:36:57 +08:00
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:
parent
02a85972de
commit
08dd033e51
@ -76,9 +76,9 @@ export class SkeletonDebugRenderer implements Disposable {
|
|||||||
let bone = bones[i];
|
let bone = bones[i];
|
||||||
if (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1) continue;
|
if (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1) continue;
|
||||||
if (!bone.parent) continue;
|
if (!bone.parent) continue;
|
||||||
let x = skeletonX + bone.data.length * bone.a + bone.worldX;
|
let x = bone.data.length * bone.a + bone.worldX;
|
||||||
let y = skeletonY + bone.data.length * bone.c + bone.worldY;
|
let y = bone.data.length * bone.c + bone.worldY;
|
||||||
shapes.rectLine(true, skeletonX + bone.worldX, skeletonY + bone.worldY, x, y, this.boneWidth * this.scale);
|
shapes.rectLine(true, bone.worldX, bone.worldY, x, y, this.boneWidth * this.scale);
|
||||||
}
|
}
|
||||||
if (this.drawSkeletonXY) shapes.x(skeletonX, skeletonY, 4 * 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++) {
|
for (let i = 0, n = bones.length; i < n; i++) {
|
||||||
let bone = bones[i];
|
let bone = bones[i];
|
||||||
if (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1) continue;
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user