aboutsummaryrefslogtreecommitdiffhomepage
path: root/public/bluebey-studio/src/urlState.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/bluebey-studio/src/urlState.js')
-rw-r--r--public/bluebey-studio/src/urlState.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/public/bluebey-studio/src/urlState.js b/public/bluebey-studio/src/urlState.js
index d6fb6bd..e1e5e3e 100644
--- a/public/bluebey-studio/src/urlState.js
+++ b/public/bluebey-studio/src/urlState.js
@@ -44,9 +44,10 @@ const TAG_PLAIN = '0';
const BASE64URL = /^[A-Za-z0-9_-]+$/;
/**
- * A copy of `state` that is safe to put in a URL. Only the inline background
- * image is dropped (replaced with `null`), and only when it is a `data:` URL
- * long enough to blow up the link.
+ * A copy of `state` that is safe to put in a URL. The inline background image
+ * and the occlusion mask are both multi-megabyte data URLs, so they are
+ * dropped (a link cannot carry them) and the mask is marked off; everything
+ * else is kept.
*/
export function stripForUrl(state) {
// A JSON round-trip gives the copy for free and drops anything that could not
@@ -58,6 +59,11 @@ export function stripForUrl(state) {
if (typeof image === 'string' && image.startsWith('data:') && image.length > MAX_INLINE_IMAGE) {
copy.view.backgroundImage = null;
}
+ if (copy.view && (copy.view.occlusionMask || copy.view.occlusionInverse)) {
+ copy.view.occlusionMask = null;
+ copy.view.occlusionInverse = null;
+ copy.view.occlusionEnabled = false;
+ }
return copy;
}