diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-27 03:38:57 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-27 03:38:57 +1000 |
commit | 4585c9cafa87cad6b54397af7e9375cc31b72f89 (patch) | |
tree | befd016a13e95467197b2bd507198b53b262fead /source/core/StarImageProcessing.cpp | |
parent | 14e23a17ccf7d556d98e7dc76f1e7ad81fa70e93 (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/StarImageProcessing.cpp')
-rw-r--r-- | source/core/StarImageProcessing.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/core/StarImageProcessing.cpp b/source/core/StarImageProcessing.cpp index 4dfcf8a..e95a13f 100644 --- a/source/core/StarImageProcessing.cpp +++ b/source/core/StarImageProcessing.cpp @@ -198,8 +198,11 @@ ImageOperation imageOperationFromString(StringView string) { else if (hexLen == 8) { hexDecode(hexPtr, 8, c, 4); } - else - throw ImageOperationException(strf("Improper size for hex string '%s' in imageOperationFromString", StringView(hexPtr, hexLen)), false); + else if (!which || (ptr != end && ++ptr != end)) + throw ImageOperationException(strf("Improper size for hex string '%s' in imageOperationFromString", StringView(hexPtr, hexLen)), false); + else // we're in A of A=B. In vanilla only A=B pairs are evaluated, so only throw an exception if B is also there. + return move(operation); + if (which = !which) operation.colorReplaceMap[*(Vec4B*)&a] = *(Vec4B*)&b; |