Skip to content

Commit

Permalink
Fix sprite atlas loader bug (#2164)
Browse files Browse the repository at this point in the history
  • Loading branch information
cptbtptpbcptdtptp authored Jul 15, 2024
1 parent 42d9b50 commit 2ae6905
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/loader/src/SpriteAtlasLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ class SpriteAtlasLoader extends Loader<SpriteAtlas> {
const atlasItemsLen = atlasItems ? atlasItems.length : 0;
const { engine } = resourceManager;
const spriteAtlas = new SpriteAtlas(engine);
if (atlasItemsLen < 0) {
if (atlasItemsLen <= 0) {
resolve(spriteAtlas);
return;
}
chainPromises.length = 0;
for (let i = 0; i < atlasItems.length; i++) {
for (let i = 0; i < atlasItemsLen; i++) {
const atlasItem = atlasItems[i];
if (atlasItem.img) {
chainPromises.push(
Expand Down

0 comments on commit 2ae6905

Please sign in to comment.