Skip to content

Commit

Permalink
fix code formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
Canvasfull committed Oct 10, 2023
1 parent befeaba commit 63639b0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 1 addition & 2 deletions cocos/spine/lib/spine-define.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import spine from './spine-core.js';
import { js } from '../../core';

function resizeArray (array, newSize) {
function resizeArray (array, newSize): Array<any> {
if (!array) return new Array(newSize);
if (newSize === array.length) return array;

Check failure on line 32 in cocos/spine/lib/spine-define.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unsafe return of an `any` typed value
if (newSize < array.length) return array.slice(0, newSize);

Check failure on line 33 in cocos/spine/lib/spine-define.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unsafe return of an `any` typed value
Expand All @@ -42,7 +42,6 @@ function overrideDefineArrayProp (prototype: any, getPropVector: any, name: stri
const count = vectors.size();
let array = this[_name];
array = resizeArray(array, count);
//if (array[0]) return array;
for (let i = 0; i < count; i++) array[i] = vectors.get(i);
this[_name] = array;
return array;

Check failure on line 47 in cocos/spine/lib/spine-define.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unsafe return of an `any` typed value
Expand Down
4 changes: 2 additions & 2 deletions cocos/spine/skeleton-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ export class AnimationCache {
}

private updateRenderData (index: number, model: any): void {
const vc = model.vCount;
const ic = model.iCount;
const vc: number = model.vCount;
const ic: number = model.iCount;
const floatStride = (_useTint ? _byteStrideTwoColor : _byteStrideOneColor) / Float32Array.BYTES_PER_ELEMENT;
const vUint8Buf = new Uint8Array(Float32Array.BYTES_PER_ELEMENT * floatStride * vc);
const iUint16Buf = new Uint16Array(ic);
Expand Down
6 changes: 4 additions & 2 deletions cocos/spine/skeleton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ export class Skeleton extends UIRenderer {
_iLength = 0;
_iBuffer: Uint8Array | null = null;
_model: any;
_tempColor: TempColor = {r: 0, g: 0, b: 0, a: 0};
_tempColor: TempColor = { r: 0, g: 0, b: 0, a: 0 };

constructor () {
super();
Expand Down Expand Up @@ -1037,7 +1037,9 @@ export class Skeleton extends UIRenderer {
// It has no event object.
if (this._accTime === 0 && this._playCount === 0) {
this._startEntry.animation.name = this._animationName;
if (this._listener && this._listener.start) this._listener.start(this._startEntry);
if (this._listener && this._listener.start) {
this._listener.start(this._startEntry);
}
}

this._accTime += dt;
Expand Down

0 comments on commit 63639b0

Please sign in to comment.