Browse Source

SkeletonDebugRenderer fix in drawBones (#1965)

skeleton.x and skeleton.y are already added in bone.worldX and
bone.worldY.
See Bone.ts => updateWorldTransformWith.
Bastiaan 3 years ago
parent
commit
08dd033e51
1 changed files with 4 additions and 4 deletions
  1. 4 4
      spine-ts/spine-webgl/src/SkeletonDebugRenderer.ts

+ 4 - 4
spine-ts/spine-webgl/src/SkeletonDebugRenderer.ts

@@ -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);
 			}
 		}