mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 09:16:01 +08:00
[ts][phaser-v3][phaser-v4] Fix atlas page url duplication when using file:// + baseURL (#2961)
* fix(loader): use file.url instead of file.src for atlas basePath (align with Phaser #6642) * [ts][phaser] Fallback to src in atlas page loading. --------- Co-authored-by: Davide Tantillo <iamdjj@gmail.com>
This commit is contained in:
parent
4d0178dcbe
commit
4f3f5bed15
@ -374,7 +374,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))
|
if (this.loader.path && this.loader.path.length > 0 && basePath.startsWith(this.loader.path))
|
||||||
basePath = basePath.slice(this.loader.path.length);
|
basePath = basePath.slice(this.loader.path.length);
|
||||||
|
|
||||||
|
|||||||
@ -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))
|
if (this.loader.path && this.loader.path.length > 0 && basePath.startsWith(this.loader.path))
|
||||||
basePath = basePath.slice(this.loader.path.length);
|
basePath = basePath.slice(this.loader.path.length);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user