Prechádzať zdrojové kódy

[ts][pixi-v8] Ensure cached uvs array sized. Closes #2677.

Davide Tantillo 10 mesiacov pred
rodič
commit
6ddf908899
1 zmenil súbory, kde vykonal 6 pridanie a 0 odobranie
  1. 6 0
      spine-ts/spine-pixi-v8/src/Spine.ts

+ 6 - 0
spine-ts/spine-pixi-v8/src/Spine.ts

@@ -505,6 +505,12 @@ export class Spine extends ViewContainer {
 						);
 					}
 
+					// sequences uvs are known only after computeWorldVertices is invoked
+					if (cacheData.uvs.length < attachment.uvs.length) {
+						cacheData.uvs = new Float32Array(attachment.uvs.length);
+					}
+
+					// need to copy because attachments uvs are shared among skeletons using the same atlas
 					fastCopy((attachment.uvs as Float32Array).buffer, cacheData.uvs.buffer);
 
 					const skeleton = slot.bone.skeleton;