@esotericsoftware/spine-canvaskit 4.2.86 → 4.2.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/spine-canvaskit.min.mjs +1 -1
- package/dist/esm/spine-canvaskit.mjs +17 -7
- package/dist/esm/spine-canvaskit.mjs.map +2 -2
- package/dist/iife/spine-canvaskit.js +17 -7
- package/dist/iife/spine-canvaskit.js.map +2 -2
- package/dist/iife/spine-canvaskit.min.js +2 -2
- package/dist/index.js +23 -11
- package/package.json +2 -2
|
@@ -11444,7 +11444,7 @@ var SkeletonRenderer = class _SkeletonRenderer {
|
|
|
11444
11444
|
let numVertices = 0;
|
|
11445
11445
|
if (attachment instanceof RegionAttachment) {
|
|
11446
11446
|
let region = attachment;
|
|
11447
|
-
|
|
11447
|
+
if (positions.length < 8) this.scratchPositions = positions = Utils.newFloatArray(8);
|
|
11448
11448
|
numVertices = 4;
|
|
11449
11449
|
region.computeWorldVertices(slot, positions, 0, 2);
|
|
11450
11450
|
triangles = _SkeletonRenderer.QUAD_TRIANGLES;
|
|
@@ -11453,7 +11453,8 @@ var SkeletonRenderer = class _SkeletonRenderer {
|
|
|
11453
11453
|
attachmentColor = region.color;
|
|
11454
11454
|
} else if (attachment instanceof MeshAttachment) {
|
|
11455
11455
|
let mesh = attachment;
|
|
11456
|
-
|
|
11456
|
+
if (positions.length < mesh.worldVerticesLength)
|
|
11457
|
+
this.scratchPositions = positions = Utils.newFloatArray(mesh.worldVerticesLength);
|
|
11457
11458
|
numVertices = mesh.worldVerticesLength >> 1;
|
|
11458
11459
|
mesh.computeWorldVertices(
|
|
11459
11460
|
slot,
|
|
@@ -11483,9 +11484,18 @@ var SkeletonRenderer = class _SkeletonRenderer {
|
|
|
11483
11484
|
triangles.length,
|
|
11484
11485
|
uvs
|
|
11485
11486
|
);
|
|
11486
|
-
|
|
11487
|
-
|
|
11488
|
-
|
|
11487
|
+
if (clipper.clippedVertices.length > 0) {
|
|
11488
|
+
if (positions.length < clipper.clippedVertices.length)
|
|
11489
|
+
this.scratchPositions = positions = Utils.newFloatArray(clipper.clippedVertices.length);
|
|
11490
|
+
numVertices = clipper.clippedVertices.length / 2;
|
|
11491
|
+
for (let i2 = 0; i2 < clipper.clippedVertices.length; i2++)
|
|
11492
|
+
positions[i2] = clipper.clippedVertices[i2];
|
|
11493
|
+
uvs = clipper.clippedUVs;
|
|
11494
|
+
triangles = clipper.clippedTriangles;
|
|
11495
|
+
} else {
|
|
11496
|
+
clipper.clipEndWithSlot(slot);
|
|
11497
|
+
continue;
|
|
11498
|
+
}
|
|
11489
11499
|
}
|
|
11490
11500
|
let slotColor = slot.color;
|
|
11491
11501
|
let finalColor = this.tempColor;
|
|
@@ -11494,14 +11504,14 @@ var SkeletonRenderer = class _SkeletonRenderer {
|
|
|
11494
11504
|
finalColor.b = skeletonColor.b * slotColor.b * attachmentColor.b;
|
|
11495
11505
|
finalColor.a = skeletonColor.a * slotColor.a * attachmentColor.a;
|
|
11496
11506
|
if (colors.length / 4 < numVertices)
|
|
11497
|
-
colors = Utils.newFloatArray(numVertices * 4);
|
|
11507
|
+
this.scratchColors = colors = Utils.newFloatArray(numVertices * 4);
|
|
11498
11508
|
for (let i2 = 0, n2 = numVertices * 4; i2 < n2; i2 += 4) {
|
|
11499
11509
|
colors[i2] = finalColor.r;
|
|
11500
11510
|
colors[i2 + 1] = finalColor.g;
|
|
11501
11511
|
colors[i2 + 2] = finalColor.b;
|
|
11502
11512
|
colors[i2 + 3] = finalColor.a;
|
|
11503
11513
|
}
|
|
11504
|
-
const scaledUvs = this.scratchUVs.length < uvs.length ? Utils.newFloatArray(uvs.length) : this.scratchUVs;
|
|
11514
|
+
const scaledUvs = this.scratchUVs.length < uvs.length ? this.scratchUVs = Utils.newFloatArray(uvs.length) : this.scratchUVs;
|
|
11505
11515
|
const width = texture.getImage().image.width();
|
|
11506
11516
|
const height = texture.getImage().image.height();
|
|
11507
11517
|
for (let i2 = 0; i2 < uvs.length; i2 += 2) {
|