Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/core/StarAssetPath.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-06-27 03:38:57 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-06-27 03:38:57 +1000
commit4585c9cafa87cad6b54397af7e9375cc31b72f89 (patch)
treebefd016a13e95467197b2bd507198b53b262fead /source/core/StarAssetPath.cpp
parent14e23a17ccf7d556d98e7dc76f1e7ad81fa70e93 (diff)
Lazy-loading of ImageOperation inside Directives
also fixed cases of drawables not staying centered after adding directives that scale
Diffstat (limited to 'source/core/StarAssetPath.cpp')
-rw-r--r--source/core/StarAssetPath.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/source/core/StarAssetPath.cpp b/source/core/StarAssetPath.cpp
index a99ecfa..cb607fb 100644
--- a/source/core/StarAssetPath.cpp
+++ b/source/core/StarAssetPath.cpp
@@ -39,11 +39,14 @@ AssetPath AssetPath::split(String const& path) {
// Sub-paths must immediately follow base paths and must start with a ':',
// after this point any further ':' characters are not special.
if (str[end] == ':') {
- size_t beg = end;
- end = str.find_first_of("?", beg);
- size_t len = end - beg - 1;
- if (len)
- components.subPath.emplace(str.substr(beg + 1, len));
+ size_t beg = end + 1;
+ if (beg != str.size()) {
+ end = str.find_first_of("?", beg);
+ if (end == NPos && beg + 1 != str.size())
+ components.subPath.emplace(str.substr(beg));
+ else if (size_t len = end - beg)
+ components.subPath.emplace(str.substr(beg, len));
+ }
}
if (end == NPos)