@esotericsoftware/spine-canvas 4.2.45 → 4.2.46
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.
|
@@ -4465,6 +4465,11 @@ var spine = (() => {
|
|
|
4465
4465
|
wasApplied() {
|
|
4466
4466
|
return this.nextTrackLast != -1;
|
|
4467
4467
|
}
|
|
4468
|
+
/** Returns true if there is a {@link #getNext()} track entry and it will become the current track entry during the next
|
|
4469
|
+
* {@link AnimationState#update(float)}. */
|
|
4470
|
+
isNextReady() {
|
|
4471
|
+
return this.next != null && this.nextTrackLast - this.next.delay >= 0;
|
|
4472
|
+
}
|
|
4468
4473
|
};
|
|
4469
4474
|
var EventQueue = class {
|
|
4470
4475
|
objects = [];
|
|
@@ -8101,7 +8106,7 @@ var spine = (() => {
|
|
|
8101
8106
|
}
|
|
8102
8107
|
if (vertices && triangles) {
|
|
8103
8108
|
if (clipper != null && clipper.isClipping()) {
|
|
8104
|
-
clipper.clipTriangles(vertices,
|
|
8109
|
+
clipper.clipTriangles(vertices, triangles, triangles.length);
|
|
8105
8110
|
vertices = clipper.clippedVertices;
|
|
8106
8111
|
verticesLength = clipper.clippedVertices.length;
|
|
8107
8112
|
}
|
|
@@ -10306,74 +10311,70 @@ var spine = (() => {
|
|
|
10306
10311
|
isClipping() {
|
|
10307
10312
|
return this.clipAttachment != null;
|
|
10308
10313
|
}
|
|
10309
|
-
clipTriangles(vertices,
|
|
10314
|
+
clipTriangles(vertices, triangles, trianglesLength, uvs, light, dark, twoColor) {
|
|
10310
10315
|
if (uvs && light && dark && typeof twoColor === "boolean")
|
|
10311
|
-
this.clipTrianglesRender(vertices,
|
|
10316
|
+
this.clipTrianglesRender(vertices, triangles, trianglesLength, uvs, light, dark, twoColor);
|
|
10312
10317
|
else
|
|
10313
|
-
this.clipTrianglesNoRender(vertices,
|
|
10318
|
+
this.clipTrianglesNoRender(vertices, triangles, trianglesLength);
|
|
10314
10319
|
}
|
|
10315
|
-
clipTrianglesNoRender(vertices,
|
|
10320
|
+
clipTrianglesNoRender(vertices, triangles, trianglesLength) {
|
|
10316
10321
|
let clipOutput = this.clipOutput, clippedVertices = this.clippedVertices;
|
|
10317
10322
|
let clippedTriangles = this.clippedTriangles;
|
|
10318
10323
|
let polygons = this.clippingPolygons;
|
|
10319
10324
|
let polygonsCount = polygons.length;
|
|
10320
|
-
let vertexSize = 2;
|
|
10321
10325
|
let index = 0;
|
|
10322
10326
|
clippedVertices.length = 0;
|
|
10323
10327
|
clippedTriangles.length = 0;
|
|
10324
|
-
|
|
10325
|
-
|
|
10326
|
-
|
|
10327
|
-
|
|
10328
|
-
|
|
10329
|
-
|
|
10330
|
-
|
|
10331
|
-
|
|
10332
|
-
|
|
10333
|
-
|
|
10334
|
-
|
|
10335
|
-
|
|
10336
|
-
|
|
10337
|
-
|
|
10338
|
-
|
|
10339
|
-
|
|
10340
|
-
|
|
10341
|
-
|
|
10342
|
-
|
|
10343
|
-
|
|
10344
|
-
|
|
10345
|
-
|
|
10346
|
-
|
|
10347
|
-
|
|
10348
|
-
|
|
10349
|
-
clipOutputCount--;
|
|
10350
|
-
for (let ii = 1; ii < clipOutputCount; ii++) {
|
|
10351
|
-
clippedTrianglesItems[s] = index;
|
|
10352
|
-
clippedTrianglesItems[s + 1] = index + ii;
|
|
10353
|
-
clippedTrianglesItems[s + 2] = index + ii + 1;
|
|
10354
|
-
s += 3;
|
|
10355
|
-
}
|
|
10356
|
-
index += clipOutputCount + 1;
|
|
10357
|
-
} else {
|
|
10358
|
-
let clippedVerticesItems = Utils.setArraySize(clippedVertices, s + 3 * vertexSize);
|
|
10359
|
-
clippedVerticesItems[s] = x1;
|
|
10360
|
-
clippedVerticesItems[s + 1] = y1;
|
|
10361
|
-
clippedVerticesItems[s + 2] = x2;
|
|
10362
|
-
clippedVerticesItems[s + 3] = y2;
|
|
10363
|
-
clippedVerticesItems[s + 4] = x3;
|
|
10364
|
-
clippedVerticesItems[s + 5] = y3;
|
|
10365
|
-
s = clippedTriangles.length;
|
|
10366
|
-
let clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3);
|
|
10328
|
+
for (let i = 0; i < trianglesLength; i += 3) {
|
|
10329
|
+
let vertexOffset = triangles[i] << 1;
|
|
10330
|
+
let x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1];
|
|
10331
|
+
vertexOffset = triangles[i + 1] << 1;
|
|
10332
|
+
let x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1];
|
|
10333
|
+
vertexOffset = triangles[i + 2] << 1;
|
|
10334
|
+
let x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1];
|
|
10335
|
+
for (let p = 0; p < polygonsCount; p++) {
|
|
10336
|
+
let s = clippedVertices.length;
|
|
10337
|
+
if (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) {
|
|
10338
|
+
let clipOutputLength = clipOutput.length;
|
|
10339
|
+
if (clipOutputLength == 0)
|
|
10340
|
+
continue;
|
|
10341
|
+
let clipOutputCount = clipOutputLength >> 1;
|
|
10342
|
+
let clipOutputItems = this.clipOutput;
|
|
10343
|
+
let clippedVerticesItems = Utils.setArraySize(clippedVertices, s + clipOutputCount * 2);
|
|
10344
|
+
for (let ii = 0; ii < clipOutputLength; ii += 2, s += 2) {
|
|
10345
|
+
let x = clipOutputItems[ii], y = clipOutputItems[ii + 1];
|
|
10346
|
+
clippedVerticesItems[s] = x;
|
|
10347
|
+
clippedVerticesItems[s + 1] = y;
|
|
10348
|
+
}
|
|
10349
|
+
s = clippedTriangles.length;
|
|
10350
|
+
let clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2));
|
|
10351
|
+
clipOutputCount--;
|
|
10352
|
+
for (let ii = 1; ii < clipOutputCount; ii++, s += 3) {
|
|
10367
10353
|
clippedTrianglesItems[s] = index;
|
|
10368
|
-
clippedTrianglesItems[s + 1] = index +
|
|
10369
|
-
clippedTrianglesItems[s + 2] = index +
|
|
10370
|
-
index += 3;
|
|
10371
|
-
continue outer;
|
|
10354
|
+
clippedTrianglesItems[s + 1] = index + ii;
|
|
10355
|
+
clippedTrianglesItems[s + 2] = index + ii + 1;
|
|
10372
10356
|
}
|
|
10357
|
+
index += clipOutputCount + 1;
|
|
10358
|
+
} else {
|
|
10359
|
+
let clippedVerticesItems = Utils.setArraySize(clippedVertices, s + 3 * 2);
|
|
10360
|
+
clippedVerticesItems[s] = x1;
|
|
10361
|
+
clippedVerticesItems[s + 1] = y1;
|
|
10362
|
+
clippedVerticesItems[s + 2] = x2;
|
|
10363
|
+
clippedVerticesItems[s + 3] = y2;
|
|
10364
|
+
clippedVerticesItems[s + 4] = x3;
|
|
10365
|
+
clippedVerticesItems[s + 5] = y3;
|
|
10366
|
+
s = clippedTriangles.length;
|
|
10367
|
+
let clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3);
|
|
10368
|
+
clippedTrianglesItems[s] = index;
|
|
10369
|
+
clippedTrianglesItems[s + 1] = index + 1;
|
|
10370
|
+
clippedTrianglesItems[s + 2] = index + 2;
|
|
10371
|
+
index += 3;
|
|
10372
|
+
break;
|
|
10373
10373
|
}
|
|
10374
10374
|
}
|
|
10375
|
+
}
|
|
10375
10376
|
}
|
|
10376
|
-
clipTrianglesRender(vertices,
|
|
10377
|
+
clipTrianglesRender(vertices, triangles, trianglesLength, uvs, light, dark, twoColor) {
|
|
10377
10378
|
let clipOutput = this.clipOutput, clippedVertices = this.clippedVertices;
|
|
10378
10379
|
let clippedTriangles = this.clippedTriangles;
|
|
10379
10380
|
let polygons = this.clippingPolygons;
|
|
@@ -10382,129 +10383,126 @@ var spine = (() => {
|
|
|
10382
10383
|
let index = 0;
|
|
10383
10384
|
clippedVertices.length = 0;
|
|
10384
10385
|
clippedTriangles.length = 0;
|
|
10385
|
-
|
|
10386
|
-
|
|
10387
|
-
|
|
10388
|
-
|
|
10389
|
-
|
|
10390
|
-
|
|
10391
|
-
|
|
10392
|
-
|
|
10393
|
-
|
|
10394
|
-
|
|
10395
|
-
|
|
10396
|
-
|
|
10397
|
-
|
|
10398
|
-
|
|
10399
|
-
|
|
10400
|
-
|
|
10401
|
-
|
|
10402
|
-
|
|
10403
|
-
|
|
10404
|
-
|
|
10405
|
-
|
|
10406
|
-
|
|
10407
|
-
|
|
10408
|
-
|
|
10409
|
-
|
|
10410
|
-
clippedVerticesItems[s + 1] = y;
|
|
10411
|
-
clippedVerticesItems[s + 2] = light.r;
|
|
10412
|
-
clippedVerticesItems[s + 3] = light.g;
|
|
10413
|
-
clippedVerticesItems[s + 4] = light.b;
|
|
10414
|
-
clippedVerticesItems[s + 5] = light.a;
|
|
10415
|
-
let c0 = x - x3, c1 = y - y3;
|
|
10416
|
-
let a = (d0 * c0 + d1 * c1) * d;
|
|
10417
|
-
let b = (d4 * c0 + d2 * c1) * d;
|
|
10418
|
-
let c = 1 - a - b;
|
|
10419
|
-
clippedVerticesItems[s + 6] = u1 * a + u2 * b + u3 * c;
|
|
10420
|
-
clippedVerticesItems[s + 7] = v1 * a + v2 * b + v3 * c;
|
|
10421
|
-
if (twoColor) {
|
|
10422
|
-
clippedVerticesItems[s + 8] = dark.r;
|
|
10423
|
-
clippedVerticesItems[s + 9] = dark.g;
|
|
10424
|
-
clippedVerticesItems[s + 10] = dark.b;
|
|
10425
|
-
clippedVerticesItems[s + 11] = dark.a;
|
|
10426
|
-
}
|
|
10427
|
-
s += vertexSize;
|
|
10428
|
-
}
|
|
10429
|
-
s = clippedTriangles.length;
|
|
10430
|
-
let clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2));
|
|
10431
|
-
clipOutputCount--;
|
|
10432
|
-
for (let ii = 1; ii < clipOutputCount; ii++) {
|
|
10433
|
-
clippedTrianglesItems[s] = index;
|
|
10434
|
-
clippedTrianglesItems[s + 1] = index + ii;
|
|
10435
|
-
clippedTrianglesItems[s + 2] = index + ii + 1;
|
|
10436
|
-
s += 3;
|
|
10437
|
-
}
|
|
10438
|
-
index += clipOutputCount + 1;
|
|
10439
|
-
} else {
|
|
10440
|
-
let clippedVerticesItems = Utils.setArraySize(clippedVertices, s + 3 * vertexSize);
|
|
10441
|
-
clippedVerticesItems[s] = x1;
|
|
10442
|
-
clippedVerticesItems[s + 1] = y1;
|
|
10386
|
+
for (let i = 0; i < trianglesLength; i += 3) {
|
|
10387
|
+
let vertexOffset = triangles[i] << 1;
|
|
10388
|
+
let x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1];
|
|
10389
|
+
let u1 = uvs[vertexOffset], v1 = uvs[vertexOffset + 1];
|
|
10390
|
+
vertexOffset = triangles[i + 1] << 1;
|
|
10391
|
+
let x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1];
|
|
10392
|
+
let u2 = uvs[vertexOffset], v2 = uvs[vertexOffset + 1];
|
|
10393
|
+
vertexOffset = triangles[i + 2] << 1;
|
|
10394
|
+
let x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1];
|
|
10395
|
+
let u3 = uvs[vertexOffset], v3 = uvs[vertexOffset + 1];
|
|
10396
|
+
for (let p = 0; p < polygonsCount; p++) {
|
|
10397
|
+
let s = clippedVertices.length;
|
|
10398
|
+
if (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) {
|
|
10399
|
+
let clipOutputLength = clipOutput.length;
|
|
10400
|
+
if (clipOutputLength == 0)
|
|
10401
|
+
continue;
|
|
10402
|
+
let d0 = y2 - y3, d1 = x3 - x2, d2 = x1 - x3, d4 = y3 - y1;
|
|
10403
|
+
let d = 1 / (d0 * d2 + d1 * (y1 - y3));
|
|
10404
|
+
let clipOutputCount = clipOutputLength >> 1;
|
|
10405
|
+
let clipOutputItems = this.clipOutput;
|
|
10406
|
+
let clippedVerticesItems = Utils.setArraySize(clippedVertices, s + clipOutputCount * vertexSize);
|
|
10407
|
+
for (let ii = 0; ii < clipOutputLength; ii += 2, s += vertexSize) {
|
|
10408
|
+
let x = clipOutputItems[ii], y = clipOutputItems[ii + 1];
|
|
10409
|
+
clippedVerticesItems[s] = x;
|
|
10410
|
+
clippedVerticesItems[s + 1] = y;
|
|
10443
10411
|
clippedVerticesItems[s + 2] = light.r;
|
|
10444
10412
|
clippedVerticesItems[s + 3] = light.g;
|
|
10445
10413
|
clippedVerticesItems[s + 4] = light.b;
|
|
10446
10414
|
clippedVerticesItems[s + 5] = light.a;
|
|
10447
|
-
|
|
10448
|
-
|
|
10449
|
-
|
|
10450
|
-
|
|
10451
|
-
|
|
10452
|
-
|
|
10453
|
-
|
|
10454
|
-
clippedVerticesItems[s + 12] = light.b;
|
|
10455
|
-
clippedVerticesItems[s + 13] = light.a;
|
|
10456
|
-
clippedVerticesItems[s + 14] = u2;
|
|
10457
|
-
clippedVerticesItems[s + 15] = v2;
|
|
10458
|
-
clippedVerticesItems[s + 16] = x3;
|
|
10459
|
-
clippedVerticesItems[s + 17] = y3;
|
|
10460
|
-
clippedVerticesItems[s + 18] = light.r;
|
|
10461
|
-
clippedVerticesItems[s + 19] = light.g;
|
|
10462
|
-
clippedVerticesItems[s + 20] = light.b;
|
|
10463
|
-
clippedVerticesItems[s + 21] = light.a;
|
|
10464
|
-
clippedVerticesItems[s + 22] = u3;
|
|
10465
|
-
clippedVerticesItems[s + 23] = v3;
|
|
10466
|
-
} else {
|
|
10467
|
-
clippedVerticesItems[s + 6] = u1;
|
|
10468
|
-
clippedVerticesItems[s + 7] = v1;
|
|
10415
|
+
let c0 = x - x3, c1 = y - y3;
|
|
10416
|
+
let a = (d0 * c0 + d1 * c1) * d;
|
|
10417
|
+
let b = (d4 * c0 + d2 * c1) * d;
|
|
10418
|
+
let c = 1 - a - b;
|
|
10419
|
+
clippedVerticesItems[s + 6] = u1 * a + u2 * b + u3 * c;
|
|
10420
|
+
clippedVerticesItems[s + 7] = v1 * a + v2 * b + v3 * c;
|
|
10421
|
+
if (twoColor) {
|
|
10469
10422
|
clippedVerticesItems[s + 8] = dark.r;
|
|
10470
10423
|
clippedVerticesItems[s + 9] = dark.g;
|
|
10471
10424
|
clippedVerticesItems[s + 10] = dark.b;
|
|
10472
10425
|
clippedVerticesItems[s + 11] = dark.a;
|
|
10473
|
-
clippedVerticesItems[s + 12] = x2;
|
|
10474
|
-
clippedVerticesItems[s + 13] = y2;
|
|
10475
|
-
clippedVerticesItems[s + 14] = light.r;
|
|
10476
|
-
clippedVerticesItems[s + 15] = light.g;
|
|
10477
|
-
clippedVerticesItems[s + 16] = light.b;
|
|
10478
|
-
clippedVerticesItems[s + 17] = light.a;
|
|
10479
|
-
clippedVerticesItems[s + 18] = u2;
|
|
10480
|
-
clippedVerticesItems[s + 19] = v2;
|
|
10481
|
-
clippedVerticesItems[s + 20] = dark.r;
|
|
10482
|
-
clippedVerticesItems[s + 21] = dark.g;
|
|
10483
|
-
clippedVerticesItems[s + 22] = dark.b;
|
|
10484
|
-
clippedVerticesItems[s + 23] = dark.a;
|
|
10485
|
-
clippedVerticesItems[s + 24] = x3;
|
|
10486
|
-
clippedVerticesItems[s + 25] = y3;
|
|
10487
|
-
clippedVerticesItems[s + 26] = light.r;
|
|
10488
|
-
clippedVerticesItems[s + 27] = light.g;
|
|
10489
|
-
clippedVerticesItems[s + 28] = light.b;
|
|
10490
|
-
clippedVerticesItems[s + 29] = light.a;
|
|
10491
|
-
clippedVerticesItems[s + 30] = u3;
|
|
10492
|
-
clippedVerticesItems[s + 31] = v3;
|
|
10493
|
-
clippedVerticesItems[s + 32] = dark.r;
|
|
10494
|
-
clippedVerticesItems[s + 33] = dark.g;
|
|
10495
|
-
clippedVerticesItems[s + 34] = dark.b;
|
|
10496
|
-
clippedVerticesItems[s + 35] = dark.a;
|
|
10497
10426
|
}
|
|
10498
|
-
|
|
10499
|
-
|
|
10427
|
+
}
|
|
10428
|
+
s = clippedTriangles.length;
|
|
10429
|
+
let clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2));
|
|
10430
|
+
clipOutputCount--;
|
|
10431
|
+
for (let ii = 1; ii < clipOutputCount; ii++, s += 3) {
|
|
10500
10432
|
clippedTrianglesItems[s] = index;
|
|
10501
|
-
clippedTrianglesItems[s + 1] = index +
|
|
10502
|
-
clippedTrianglesItems[s + 2] = index +
|
|
10503
|
-
index += 3;
|
|
10504
|
-
continue outer;
|
|
10433
|
+
clippedTrianglesItems[s + 1] = index + ii;
|
|
10434
|
+
clippedTrianglesItems[s + 2] = index + ii + 1;
|
|
10505
10435
|
}
|
|
10436
|
+
index += clipOutputCount + 1;
|
|
10437
|
+
} else {
|
|
10438
|
+
let clippedVerticesItems = Utils.setArraySize(clippedVertices, s + 3 * vertexSize);
|
|
10439
|
+
clippedVerticesItems[s] = x1;
|
|
10440
|
+
clippedVerticesItems[s + 1] = y1;
|
|
10441
|
+
clippedVerticesItems[s + 2] = light.r;
|
|
10442
|
+
clippedVerticesItems[s + 3] = light.g;
|
|
10443
|
+
clippedVerticesItems[s + 4] = light.b;
|
|
10444
|
+
clippedVerticesItems[s + 5] = light.a;
|
|
10445
|
+
if (!twoColor) {
|
|
10446
|
+
clippedVerticesItems[s + 6] = u1;
|
|
10447
|
+
clippedVerticesItems[s + 7] = v1;
|
|
10448
|
+
clippedVerticesItems[s + 8] = x2;
|
|
10449
|
+
clippedVerticesItems[s + 9] = y2;
|
|
10450
|
+
clippedVerticesItems[s + 10] = light.r;
|
|
10451
|
+
clippedVerticesItems[s + 11] = light.g;
|
|
10452
|
+
clippedVerticesItems[s + 12] = light.b;
|
|
10453
|
+
clippedVerticesItems[s + 13] = light.a;
|
|
10454
|
+
clippedVerticesItems[s + 14] = u2;
|
|
10455
|
+
clippedVerticesItems[s + 15] = v2;
|
|
10456
|
+
clippedVerticesItems[s + 16] = x3;
|
|
10457
|
+
clippedVerticesItems[s + 17] = y3;
|
|
10458
|
+
clippedVerticesItems[s + 18] = light.r;
|
|
10459
|
+
clippedVerticesItems[s + 19] = light.g;
|
|
10460
|
+
clippedVerticesItems[s + 20] = light.b;
|
|
10461
|
+
clippedVerticesItems[s + 21] = light.a;
|
|
10462
|
+
clippedVerticesItems[s + 22] = u3;
|
|
10463
|
+
clippedVerticesItems[s + 23] = v3;
|
|
10464
|
+
} else {
|
|
10465
|
+
clippedVerticesItems[s + 6] = u1;
|
|
10466
|
+
clippedVerticesItems[s + 7] = v1;
|
|
10467
|
+
clippedVerticesItems[s + 8] = dark.r;
|
|
10468
|
+
clippedVerticesItems[s + 9] = dark.g;
|
|
10469
|
+
clippedVerticesItems[s + 10] = dark.b;
|
|
10470
|
+
clippedVerticesItems[s + 11] = dark.a;
|
|
10471
|
+
clippedVerticesItems[s + 12] = x2;
|
|
10472
|
+
clippedVerticesItems[s + 13] = y2;
|
|
10473
|
+
clippedVerticesItems[s + 14] = light.r;
|
|
10474
|
+
clippedVerticesItems[s + 15] = light.g;
|
|
10475
|
+
clippedVerticesItems[s + 16] = light.b;
|
|
10476
|
+
clippedVerticesItems[s + 17] = light.a;
|
|
10477
|
+
clippedVerticesItems[s + 18] = u2;
|
|
10478
|
+
clippedVerticesItems[s + 19] = v2;
|
|
10479
|
+
clippedVerticesItems[s + 20] = dark.r;
|
|
10480
|
+
clippedVerticesItems[s + 21] = dark.g;
|
|
10481
|
+
clippedVerticesItems[s + 22] = dark.b;
|
|
10482
|
+
clippedVerticesItems[s + 23] = dark.a;
|
|
10483
|
+
clippedVerticesItems[s + 24] = x3;
|
|
10484
|
+
clippedVerticesItems[s + 25] = y3;
|
|
10485
|
+
clippedVerticesItems[s + 26] = light.r;
|
|
10486
|
+
clippedVerticesItems[s + 27] = light.g;
|
|
10487
|
+
clippedVerticesItems[s + 28] = light.b;
|
|
10488
|
+
clippedVerticesItems[s + 29] = light.a;
|
|
10489
|
+
clippedVerticesItems[s + 30] = u3;
|
|
10490
|
+
clippedVerticesItems[s + 31] = v3;
|
|
10491
|
+
clippedVerticesItems[s + 32] = dark.r;
|
|
10492
|
+
clippedVerticesItems[s + 33] = dark.g;
|
|
10493
|
+
clippedVerticesItems[s + 34] = dark.b;
|
|
10494
|
+
clippedVerticesItems[s + 35] = dark.a;
|
|
10495
|
+
}
|
|
10496
|
+
s = clippedTriangles.length;
|
|
10497
|
+
let clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3);
|
|
10498
|
+
clippedTrianglesItems[s] = index;
|
|
10499
|
+
clippedTrianglesItems[s + 1] = index + 1;
|
|
10500
|
+
clippedTrianglesItems[s + 2] = index + 2;
|
|
10501
|
+
index += 3;
|
|
10502
|
+
break;
|
|
10506
10503
|
}
|
|
10507
10504
|
}
|
|
10505
|
+
}
|
|
10508
10506
|
}
|
|
10509
10507
|
/** Clips the input triangle against the convex, clockwise clipping area. If the triangle lies entirely within the clipping
|
|
10510
10508
|
* area, false is returned. The clipping area must duplicate the first vertex at the end of the vertices list. */
|
|
@@ -10527,47 +10525,46 @@ var spine = (() => {
|
|
|
10527
10525
|
input.push(x1);
|
|
10528
10526
|
input.push(y1);
|
|
10529
10527
|
output.length = 0;
|
|
10530
|
-
let clippingVertices = clippingArea;
|
|
10531
10528
|
let clippingVerticesLast = clippingArea.length - 4;
|
|
10529
|
+
let clippingVertices = clippingArea;
|
|
10532
10530
|
for (let i = 0; ; i += 2) {
|
|
10533
10531
|
let edgeX = clippingVertices[i], edgeY = clippingVertices[i + 1];
|
|
10534
|
-
let
|
|
10535
|
-
let
|
|
10532
|
+
let ex = edgeX - clippingVertices[i + 2], ey = edgeY - clippingVertices[i + 3];
|
|
10533
|
+
let outputStart = output.length;
|
|
10536
10534
|
let inputVertices = input;
|
|
10537
|
-
let
|
|
10538
|
-
for (let ii = 0; ii < inputVerticesLength; ii += 2) {
|
|
10535
|
+
for (let ii = 0, nn = input.length - 2; ii < nn; ) {
|
|
10539
10536
|
let inputX = inputVertices[ii], inputY = inputVertices[ii + 1];
|
|
10540
|
-
|
|
10541
|
-
let
|
|
10542
|
-
|
|
10543
|
-
|
|
10537
|
+
ii += 2;
|
|
10538
|
+
let inputX2 = inputVertices[ii], inputY2 = inputVertices[ii + 1];
|
|
10539
|
+
let s2 = ey * (edgeX - inputX2) > ex * (edgeY - inputY2);
|
|
10540
|
+
let s1 = ey * (edgeX - inputX) - ex * (edgeY - inputY);
|
|
10541
|
+
if (s1 > 0) {
|
|
10542
|
+
if (s2) {
|
|
10544
10543
|
output.push(inputX2);
|
|
10545
10544
|
output.push(inputY2);
|
|
10546
10545
|
continue;
|
|
10547
10546
|
}
|
|
10548
|
-
let
|
|
10549
|
-
|
|
10550
|
-
|
|
10551
|
-
|
|
10552
|
-
output.push(edgeX + (edgeX2 - edgeX) * ua);
|
|
10553
|
-
output.push(edgeY + (edgeY2 - edgeY) * ua);
|
|
10547
|
+
let ix = inputX2 - inputX, iy = inputY2 - inputY, t = s1 / (ix * ey - iy * ex);
|
|
10548
|
+
if (t >= 0 && t <= 1) {
|
|
10549
|
+
output.push(inputX + ix * t);
|
|
10550
|
+
output.push(inputY + iy * t);
|
|
10554
10551
|
} else {
|
|
10555
|
-
output.push(
|
|
10556
|
-
output.push(
|
|
10552
|
+
output.push(inputX2);
|
|
10553
|
+
output.push(inputY2);
|
|
10554
|
+
continue;
|
|
10557
10555
|
}
|
|
10558
|
-
} else if (
|
|
10559
|
-
let
|
|
10560
|
-
|
|
10561
|
-
|
|
10562
|
-
|
|
10563
|
-
output.push(
|
|
10564
|
-
output.push(
|
|
10556
|
+
} else if (s2) {
|
|
10557
|
+
let ix = inputX2 - inputX, iy = inputY2 - inputY, t = s1 / (ix * ey - iy * ex);
|
|
10558
|
+
if (t >= 0 && t <= 1) {
|
|
10559
|
+
output.push(inputX + ix * t);
|
|
10560
|
+
output.push(inputY + iy * t);
|
|
10561
|
+
output.push(inputX2);
|
|
10562
|
+
output.push(inputY2);
|
|
10565
10563
|
} else {
|
|
10566
|
-
output.push(
|
|
10567
|
-
output.push(
|
|
10564
|
+
output.push(inputX2);
|
|
10565
|
+
output.push(inputY2);
|
|
10566
|
+
continue;
|
|
10568
10567
|
}
|
|
10569
|
-
output.push(inputX2);
|
|
10570
|
-
output.push(inputY2);
|
|
10571
10568
|
}
|
|
10572
10569
|
clipped = true;
|
|
10573
10570
|
}
|