From dfa6098aa674a37beec9ec56a55ff469ce1589d8 Mon Sep 17 00:00:00 2001 From: Gordon Cummings <57897263+GordonTombola@users.noreply.github.com> Date: Mon, 12 Aug 2024 10:34:37 +0100 Subject: [PATCH] clipping mask vertices fix in the case of weighted vertices on clipping attachments, we were previously using the length of the vertices array, which is not the same as the worldVerticesLength example clipping attachment data: "vertexCount": 4, "vertices": [ 1, 15, -47.71, 34.91, 1, 1, 18, -47.86, -35.06, 1, 1, 17, 47.8, -34.9, 1, 1, 16, 47.81, 34.87, 1 ], resulting vertices length would be 12 we actually needed 8 the result is an array with 8 correct numbers and 4 trailing numbers from the vertices array --- spine-ts/spine-pixi/src/Spine.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spine-ts/spine-pixi/src/Spine.ts b/spine-ts/spine-pixi/src/Spine.ts index 147c93803..b22642cfb 100644 --- a/spine-ts/spine-pixi/src/Spine.ts +++ b/spine-ts/spine-pixi/src/Spine.ts @@ -341,7 +341,7 @@ export class Spine extends Container { if (!pixiMaskSource.computed) { pixiMaskSource.computed = true; const clippingAttachment = pixiMaskSource.slot.attachment as ClippingAttachment; - const world = Array.from(clippingAttachment.vertices); + const world = new Array(clippingAttachment.worldVerticesLength); clippingAttachment.computeWorldVertices(pixiMaskSource.slot, 0, clippingAttachment.worldVerticesLength, world, 0, 2); mask.clear().lineStyle(0).beginFill(0x000000).drawPolygon(world); }