[ts][phaser-v3][phaser-v4] Fix atlas page url duplication when using file:// + baseURL (#2961)

This commit is contained in:
Davide Tantillo 2025-10-27 17:29:20 +01:00
parent 022a4bacbd
commit eb4fb09765
2 changed files with 6 additions and 2 deletions

View File

@ -377,7 +377,9 @@ class SpineAtlasFile extends Phaser.Loader.MultiFile {
}
}
let basePath = (file.src.match(/^.*\//) ?? "").toString();
let fileUrl = file.url;
if (typeof fileUrl === "object") fileUrl = file.src;
let basePath = (fileUrl.match(/^.*\//) ?? "").toString();
if (this.loader.path && this.loader.path.length > 0 && basePath.startsWith(this.loader.path))
basePath = basePath.slice(this.loader.path.length);

View File

@ -366,7 +366,9 @@ class SpineAtlasFile extends Phaser.Loader.MultiFile {
}
}
let basePath = (file.src.match(/^.*\//) ?? "").toString();
let fileUrl = file.url;
if (typeof fileUrl === "object") fileUrl = file.src;
let basePath = (fileUrl.match(/^.*\//) ?? "").toString();
if (this.loader.path && this.loader.path.length > 0 && basePath.startsWith(this.loader.path))
basePath = basePath.slice(this.loader.path.length);