@surdeddd/bottom-sheet 0.23.1 → 0.23.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/element.cjs +3 -1
- package/dist/element.iife.global.js +2 -2
- package/dist/element.js +3 -1
- package/dist/features.cjs +2 -0
- package/dist/features.js +2 -0
- package/dist/index.cjs +2 -0
- package/dist/index.js +2 -0
- package/dist/qwik-lib/index.qwik.cjs +2 -0
- package/dist/qwik-lib/index.qwik.mjs +2 -0
- package/dist/qwik.cjs +2 -0
- package/dist/qwik.js +2 -0
- package/dist/react.cjs +2 -0
- package/dist/react.js +2 -0
- package/dist/solid.cjs +2 -0
- package/dist/solid.js +2 -0
- package/dist/solid.source.jsx +2 -0
- package/dist/styles.css +8 -6
- package/dist/svelte-core.cjs +2 -0
- package/dist/svelte-core.js +2 -0
- package/dist/svelte.cjs +2 -0
- package/dist/svelte.js +2 -0
- package/dist/vue.cjs +2 -0
- package/dist/vue.js +2 -0
- package/dist/webgl.cjs +192 -42
- package/dist/webgl.js +192 -42
- package/package.json +3 -3
package/dist/webgl.cjs
CHANGED
|
@@ -110,6 +110,10 @@ uniform float u_sheen;
|
|
|
110
110
|
uniform float u_glass;
|
|
111
111
|
uniform float u_hasContent;
|
|
112
112
|
uniform sampler2D u_content;
|
|
113
|
+
uniform float u_hasScroll;
|
|
114
|
+
uniform sampler2D u_scroll;
|
|
115
|
+
uniform vec4 u_scrollRect;
|
|
116
|
+
uniform vec2 u_scrollMap;
|
|
113
117
|
|
|
114
118
|
float roundedBoxSDF(vec2 p, vec2 halfSize, float r) {
|
|
115
119
|
vec2 q = abs(p) - halfSize + r;
|
|
@@ -145,6 +149,19 @@ void main() {
|
|
|
145
149
|
content = texture2D(u_content, glassUv);
|
|
146
150
|
}
|
|
147
151
|
|
|
152
|
+
vec4 scroll = vec4(0.0);
|
|
153
|
+
if (u_hasScroll > 0.5 &&
|
|
154
|
+
glassUv.x >= u_scrollRect.x && glassUv.x <= u_scrollRect.z &&
|
|
155
|
+
glassUv.y >= u_scrollRect.y && glassUv.y <= u_scrollRect.w) {
|
|
156
|
+
vec2 st = vec2(
|
|
157
|
+
(glassUv.x - u_scrollRect.x) / max(u_scrollRect.z - u_scrollRect.x, 0.000001),
|
|
158
|
+
(glassUv.y - u_scrollRect.y) * u_scrollMap.x + u_scrollMap.y
|
|
159
|
+
);
|
|
160
|
+
if (st.y >= 0.0 && st.y <= 1.0) {
|
|
161
|
+
scroll = texture2D(u_scroll, st);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
148
165
|
float edge = 1.0 - smoothstep(0.0, 2.5, abs(d));
|
|
149
166
|
float topLight = pow(1.0 - down, 3.0);
|
|
150
167
|
float sheen = (edge * 0.55 + topLight * 0.25) * u_sheen;
|
|
@@ -152,8 +169,10 @@ void main() {
|
|
|
152
169
|
vec3 panelRgb = (u_color.rgb + vec3(sheen)) * u_color.a;
|
|
153
170
|
float panelA = u_color.a;
|
|
154
171
|
|
|
155
|
-
vec3
|
|
156
|
-
float
|
|
172
|
+
vec3 baseRgb = content.rgb + panelRgb * (1.0 - content.a);
|
|
173
|
+
float baseA = content.a + panelA * (1.0 - content.a);
|
|
174
|
+
vec3 rgb = scroll.rgb + baseRgb * (1.0 - scroll.a);
|
|
175
|
+
float alpha = scroll.a + baseA * (1.0 - scroll.a);
|
|
157
176
|
|
|
158
177
|
rgb *= surface;
|
|
159
178
|
alpha *= surface;
|
|
@@ -213,6 +232,10 @@ var createSurfaceProgram = (gl, highp = true) => {
|
|
|
213
232
|
const uGlass = gl.getUniformLocation(program, "u_glass");
|
|
214
233
|
const uHasContent = gl.getUniformLocation(program, "u_hasContent");
|
|
215
234
|
const uContent = gl.getUniformLocation(program, "u_content");
|
|
235
|
+
const uHasScroll = gl.getUniformLocation(program, "u_hasScroll");
|
|
236
|
+
const uScroll = gl.getUniformLocation(program, "u_scroll");
|
|
237
|
+
const uScrollRect = gl.getUniformLocation(program, "u_scrollRect");
|
|
238
|
+
const uScrollMap = gl.getUniformLocation(program, "u_scrollMap");
|
|
216
239
|
return {
|
|
217
240
|
draw: (frame, state) => {
|
|
218
241
|
const { drawingBufferWidth: w, drawingBufferHeight: h } = gl;
|
|
@@ -239,14 +262,25 @@ var createSurfaceProgram = (gl, highp = true) => {
|
|
|
239
262
|
gl.uniform1f(uBend, state.bend * dpr);
|
|
240
263
|
gl.uniform1f(uSheen, state.sheen);
|
|
241
264
|
gl.uniform1f(uGlass, state.glass);
|
|
265
|
+
gl.uniform1i(uContent, 0);
|
|
266
|
+
gl.uniform1i(uScroll, 1);
|
|
242
267
|
if (state.content) {
|
|
243
268
|
gl.activeTexture(gl.TEXTURE0);
|
|
244
269
|
gl.bindTexture(gl.TEXTURE_2D, state.content);
|
|
245
|
-
gl.uniform1i(uContent, 0);
|
|
246
270
|
gl.uniform1f(uHasContent, 1);
|
|
247
271
|
} else {
|
|
248
272
|
gl.uniform1f(uHasContent, 0);
|
|
249
273
|
}
|
|
274
|
+
if (state.scroll) {
|
|
275
|
+
gl.activeTexture(gl.TEXTURE1);
|
|
276
|
+
gl.bindTexture(gl.TEXTURE_2D, state.scroll.texture);
|
|
277
|
+
gl.uniform4f(uScrollRect, ...state.scroll.rect);
|
|
278
|
+
gl.uniform2f(uScrollMap, ...state.scroll.map);
|
|
279
|
+
gl.uniform1f(uHasScroll, 1);
|
|
280
|
+
gl.activeTexture(gl.TEXTURE0);
|
|
281
|
+
} else {
|
|
282
|
+
gl.uniform1f(uHasScroll, 0);
|
|
283
|
+
}
|
|
250
284
|
gl.drawArrays(gl.TRIANGLES, 0, 3);
|
|
251
285
|
},
|
|
252
286
|
destroy: () => {
|
|
@@ -315,13 +349,13 @@ var roundedPath = (ctx, x, y, w, h, r) => {
|
|
|
315
349
|
ctx.arcTo(x, y, x + w, y, rad);
|
|
316
350
|
ctx.closePath();
|
|
317
351
|
};
|
|
318
|
-
var drawBox = (ctx, cs, rect,
|
|
352
|
+
var drawBox = (ctx, cs, rect, origin) => {
|
|
319
353
|
const bg = cs.backgroundColor;
|
|
320
354
|
const borderWidth = parseFloat(cs.borderTopWidth) || 0;
|
|
321
355
|
const hasBorder = borderWidth > 0 && isPaintedColor(cs.borderTopColor);
|
|
322
356
|
if (!isPaintedColor(bg) && !hasBorder) return false;
|
|
323
|
-
const x = rect.left -
|
|
324
|
-
const y = rect.top -
|
|
357
|
+
const x = rect.left - origin.x;
|
|
358
|
+
const y = rect.top - origin.y;
|
|
325
359
|
const radius = parseFloat(cs.borderTopLeftRadius) || 0;
|
|
326
360
|
if (isPaintedColor(bg)) {
|
|
327
361
|
roundedPath(ctx, x, y, rect.width, rect.height, radius);
|
|
@@ -336,15 +370,13 @@ var drawBox = (ctx, cs, rect, rootRect) => {
|
|
|
336
370
|
}
|
|
337
371
|
return true;
|
|
338
372
|
};
|
|
339
|
-
var drawImage = (ctx, img,
|
|
373
|
+
var drawImage = (ctx, img, rect, origin) => {
|
|
340
374
|
if (!img.complete || img.naturalWidth === 0) return false;
|
|
341
|
-
const rect = img.getBoundingClientRect();
|
|
342
|
-
if (rect.width < 1 || rect.height < 1) return false;
|
|
343
375
|
try {
|
|
344
376
|
ctx.drawImage(
|
|
345
377
|
img,
|
|
346
|
-
rect.left -
|
|
347
|
-
rect.top -
|
|
378
|
+
rect.left - origin.x,
|
|
379
|
+
rect.top - origin.y,
|
|
348
380
|
rect.width,
|
|
349
381
|
rect.height
|
|
350
382
|
);
|
|
@@ -353,37 +385,41 @@ var drawImage = (ctx, img, rootRect) => {
|
|
|
353
385
|
return false;
|
|
354
386
|
}
|
|
355
387
|
};
|
|
356
|
-
var
|
|
357
|
-
const
|
|
358
|
-
const
|
|
359
|
-
const h = Math.max(1, Math.round(rootRect.height * dpr));
|
|
388
|
+
var createLayer = (width, height, scale) => {
|
|
389
|
+
const w = Math.max(1, Math.round(width * scale));
|
|
390
|
+
const h = Math.max(1, Math.round(height * scale));
|
|
360
391
|
if (w < 2 || h < 2) return null;
|
|
361
|
-
const
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
const ctx =
|
|
392
|
+
const canvas = document.createElement("canvas");
|
|
393
|
+
canvas.width = w;
|
|
394
|
+
canvas.height = h;
|
|
395
|
+
const ctx = canvas.getContext("2d");
|
|
365
396
|
if (!ctx) return null;
|
|
366
|
-
ctx.scale(
|
|
367
|
-
|
|
368
|
-
|
|
397
|
+
ctx.scale(scale, scale);
|
|
398
|
+
return { canvas, ctx };
|
|
399
|
+
};
|
|
400
|
+
var paintTree = (ctx, walker, origin, hidden) => {
|
|
369
401
|
let painted = 0;
|
|
370
402
|
while (walker.nextNode()) {
|
|
371
403
|
const el = walker.currentNode;
|
|
372
|
-
|
|
373
|
-
|
|
404
|
+
const isImage = el.tagName === "IMG";
|
|
405
|
+
if (!isImage && !isRenderable(el)) continue;
|
|
406
|
+
const rect = el.getBoundingClientRect();
|
|
407
|
+
if (rect.width < 1 || rect.height < 1) continue;
|
|
408
|
+
if (rect.bottom <= origin.y || rect.top >= origin.y + origin.height) {
|
|
409
|
+
continue;
|
|
410
|
+
}
|
|
411
|
+
if (isImage) {
|
|
412
|
+
if (drawImage(ctx, el, rect, origin)) {
|
|
374
413
|
painted++;
|
|
375
|
-
|
|
414
|
+
hidden.push(el);
|
|
376
415
|
}
|
|
377
416
|
continue;
|
|
378
417
|
}
|
|
379
|
-
if (!isRenderable(el)) continue;
|
|
380
|
-
const rect = el.getBoundingClientRect();
|
|
381
|
-
if (rect.width < 1 || rect.height < 1) continue;
|
|
382
418
|
const cs = getComputedStyle(el);
|
|
383
|
-
const boxed = drawBox(ctx, cs, rect,
|
|
419
|
+
const boxed = drawBox(ctx, cs, rect, origin);
|
|
384
420
|
if (boxed) {
|
|
385
421
|
painted++;
|
|
386
|
-
|
|
422
|
+
hidden.push(el);
|
|
387
423
|
}
|
|
388
424
|
const text = directText(el);
|
|
389
425
|
if (!text) continue;
|
|
@@ -397,12 +433,12 @@ var captureContent = (gl, root, dpr) => {
|
|
|
397
433
|
rect.width - padLeft - (parseFloat(cs.paddingRight) || 0)
|
|
398
434
|
);
|
|
399
435
|
const lineHeight = parseFloat(cs.lineHeight) || parseFloat(cs.fontSize) * 1.4;
|
|
400
|
-
const x = rect.left -
|
|
401
|
-
const y = rect.top -
|
|
436
|
+
const x = rect.left - origin.x + padLeft;
|
|
437
|
+
const y = rect.top - origin.y + padTop;
|
|
402
438
|
const lines = wrapLines(ctx, text, innerWidth);
|
|
403
439
|
lines.forEach((line, i) => {
|
|
404
440
|
const lineY = y + i * lineHeight;
|
|
405
|
-
if (lineY >
|
|
441
|
+
if (lineY > origin.height) return;
|
|
406
442
|
let lineX = x;
|
|
407
443
|
if (cs.textAlign === "center") {
|
|
408
444
|
lineX = x + (innerWidth - ctx.measureText(line).width) / 2;
|
|
@@ -413,10 +449,12 @@ var captureContent = (gl, root, dpr) => {
|
|
|
413
449
|
});
|
|
414
450
|
if (lines.length) {
|
|
415
451
|
painted++;
|
|
416
|
-
if (!boxed)
|
|
452
|
+
if (!boxed) hidden.push(el);
|
|
417
453
|
}
|
|
418
454
|
}
|
|
419
|
-
|
|
455
|
+
return painted;
|
|
456
|
+
};
|
|
457
|
+
var upload = (gl, canvas) => {
|
|
420
458
|
const texture = gl.createTexture();
|
|
421
459
|
if (!texture) return null;
|
|
422
460
|
gl.bindTexture(gl.TEXTURE_2D, texture);
|
|
@@ -428,7 +466,7 @@ var captureContent = (gl, root, dpr) => {
|
|
|
428
466
|
gl.RGBA,
|
|
429
467
|
gl.RGBA,
|
|
430
468
|
gl.UNSIGNED_BYTE,
|
|
431
|
-
|
|
469
|
+
canvas
|
|
432
470
|
);
|
|
433
471
|
} catch {
|
|
434
472
|
gl.deleteTexture(texture);
|
|
@@ -438,7 +476,78 @@ var captureContent = (gl, root, dpr) => {
|
|
|
438
476
|
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
|
|
439
477
|
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
|
440
478
|
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
|
441
|
-
return
|
|
479
|
+
return texture;
|
|
480
|
+
};
|
|
481
|
+
var scaleFor = (gl, width, height, dpr) => {
|
|
482
|
+
const max = Number(gl.getParameter(gl.MAX_TEXTURE_SIZE)) || 4096;
|
|
483
|
+
return Math.min(dpr, max / Math.max(width, height, 1));
|
|
484
|
+
};
|
|
485
|
+
var captureScroll = (gl, scroller, dpr, requestedAbove, skip, hidden) => {
|
|
486
|
+
const box = scroller.getBoundingClientRect();
|
|
487
|
+
const width = scroller.clientWidth;
|
|
488
|
+
const view = scroller.clientHeight;
|
|
489
|
+
if (width < 1 || view < 1) return null;
|
|
490
|
+
const top = scroller.scrollTop;
|
|
491
|
+
const above = Math.max(0, Math.min(requestedAbove, top));
|
|
492
|
+
const height = view + above;
|
|
493
|
+
const layer = createLayer(width, height, scaleFor(gl, width, height, dpr));
|
|
494
|
+
if (!layer) return null;
|
|
495
|
+
const origin = {
|
|
496
|
+
x: box.left + scroller.clientLeft,
|
|
497
|
+
y: box.top + scroller.clientTop - above,
|
|
498
|
+
height
|
|
499
|
+
};
|
|
500
|
+
const walker = document.createTreeWalker(scroller, NodeFilter.SHOW_ELEMENT, {
|
|
501
|
+
acceptNode: (node) => skip?.(node) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT
|
|
502
|
+
});
|
|
503
|
+
const drawn = [];
|
|
504
|
+
if (!paintTree(layer.ctx, walker, origin, drawn)) return null;
|
|
505
|
+
const texture = upload(gl, layer.canvas);
|
|
506
|
+
if (!texture) return null;
|
|
507
|
+
hidden.push(...drawn);
|
|
508
|
+
return { texture, top, above, height };
|
|
509
|
+
};
|
|
510
|
+
var captureContent = (gl, root, dpr, options = {}) => {
|
|
511
|
+
const rootRect = root.getBoundingClientRect();
|
|
512
|
+
const scroller = options.scroller && options.scroller !== root && root.contains(options.scroller) ? options.scroller : null;
|
|
513
|
+
const skip = options.skip;
|
|
514
|
+
const hiddenNodes = [];
|
|
515
|
+
let texture = null;
|
|
516
|
+
const layer = createLayer(
|
|
517
|
+
rootRect.width,
|
|
518
|
+
rootRect.height,
|
|
519
|
+
scaleFor(gl, rootRect.width, rootRect.height, dpr)
|
|
520
|
+
);
|
|
521
|
+
if (layer) {
|
|
522
|
+
const walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, {
|
|
523
|
+
acceptNode: (node) => {
|
|
524
|
+
const el = node;
|
|
525
|
+
if (scroller && el.parentElement === scroller) {
|
|
526
|
+
return NodeFilter.FILTER_REJECT;
|
|
527
|
+
}
|
|
528
|
+
return skip?.(el) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
|
|
529
|
+
}
|
|
530
|
+
});
|
|
531
|
+
const drawn = [];
|
|
532
|
+
const origin = {
|
|
533
|
+
x: rootRect.left,
|
|
534
|
+
y: rootRect.top,
|
|
535
|
+
height: rootRect.height
|
|
536
|
+
};
|
|
537
|
+
if (paintTree(layer.ctx, walker, origin, drawn)) {
|
|
538
|
+
texture = upload(gl, layer.canvas);
|
|
539
|
+
if (texture) hiddenNodes.push(...drawn);
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
const scroll = scroller ? captureScroll(gl, scroller, dpr, options.above ?? 0, skip, hiddenNodes) : null;
|
|
543
|
+
if (!texture && !scroll) return null;
|
|
544
|
+
return {
|
|
545
|
+
texture,
|
|
546
|
+
width: layer?.canvas.width ?? 0,
|
|
547
|
+
height: layer?.canvas.height ?? 0,
|
|
548
|
+
hiddenNodes,
|
|
549
|
+
scroll
|
|
550
|
+
};
|
|
442
551
|
};
|
|
443
552
|
var hideCapturedText = (nodes) => {
|
|
444
553
|
const restore = nodes.map((el) => ({
|
|
@@ -595,16 +704,46 @@ var webglRenderer = (options = {}) => ({
|
|
|
595
704
|
const releaseCapture = () => {
|
|
596
705
|
releaseText?.();
|
|
597
706
|
releaseText = null;
|
|
598
|
-
if (capture && handle)
|
|
707
|
+
if (capture && handle) {
|
|
708
|
+
if (capture.texture) handle.gl.deleteTexture(capture.texture);
|
|
709
|
+
if (capture.scroll) handle.gl.deleteTexture(capture.scroll.texture);
|
|
710
|
+
}
|
|
599
711
|
capture = null;
|
|
600
712
|
};
|
|
713
|
+
const fitted = () => element.hasAttribute("data-bs-fit-content") && element.dataset.mode === "bottom";
|
|
601
714
|
const takeCapture = () => {
|
|
602
715
|
if (!liftContent || disposed || !handle || capture) return;
|
|
603
|
-
const
|
|
716
|
+
const pinned = fitted();
|
|
717
|
+
const next = captureContent(handle.gl, element, dprOf(), {
|
|
718
|
+
scroller: ctx.scrollContainer ?? null,
|
|
719
|
+
above: pinned ? Math.max(0, ctx.getMaxAxisSize() - ctx.getSize()) : 0,
|
|
720
|
+
skip: pinned ? (el) => el.classList.contains("bs-footer") : void 0
|
|
721
|
+
});
|
|
604
722
|
if (!next) return;
|
|
605
723
|
capture = next;
|
|
606
724
|
releaseText = hideCapturedText(next.hiddenNodes);
|
|
607
725
|
};
|
|
726
|
+
const scrollLayer = (frame) => {
|
|
727
|
+
const scroll = capture?.scroll;
|
|
728
|
+
const scroller = ctx.scrollContainer;
|
|
729
|
+
if (!scroll || !scroller) return null;
|
|
730
|
+
const box = scroller.getBoundingClientRect();
|
|
731
|
+
const left = box.left + scroller.clientLeft - frame.x;
|
|
732
|
+
const top = box.top + scroller.clientTop - frame.y;
|
|
733
|
+
return {
|
|
734
|
+
texture: scroll.texture,
|
|
735
|
+
rect: [
|
|
736
|
+
left / frame.width,
|
|
737
|
+
top / frame.height,
|
|
738
|
+
(left + scroller.clientWidth) / frame.width,
|
|
739
|
+
(top + scroller.clientHeight) / frame.height
|
|
740
|
+
],
|
|
741
|
+
map: [
|
|
742
|
+
frame.height / scroll.height,
|
|
743
|
+
(scroll.above + scroller.scrollTop - scroll.top) / scroll.height
|
|
744
|
+
]
|
|
745
|
+
};
|
|
746
|
+
};
|
|
608
747
|
const paint = () => {
|
|
609
748
|
if (disposed || !handle || !program) return;
|
|
610
749
|
const frame = readFrame();
|
|
@@ -617,18 +756,20 @@ var webglRenderer = (options = {}) => ({
|
|
|
617
756
|
dpr,
|
|
618
757
|
sheen: sheenStrength,
|
|
619
758
|
glass: glassStrength * motion,
|
|
620
|
-
content: capture?.texture ?? null
|
|
759
|
+
content: capture?.texture ?? null,
|
|
760
|
+
scroll: scrollLayer(frame)
|
|
621
761
|
});
|
|
622
762
|
};
|
|
623
763
|
const tick = () => {
|
|
624
764
|
if (disposed) return;
|
|
625
|
-
paint();
|
|
626
765
|
const held = ctx.isDragging();
|
|
766
|
+
if (held || !ctx.isAnimating()) paint();
|
|
627
767
|
bend *= held ? BEND_DECAY_HELD : BEND_DECAY_FREE;
|
|
628
768
|
const flat = Math.abs(bend) < BEND_REST;
|
|
629
769
|
if (!held && flat && capture) {
|
|
630
770
|
bend = 0;
|
|
631
771
|
releaseCapture();
|
|
772
|
+
paint();
|
|
632
773
|
}
|
|
633
774
|
if (!held && flat && !ctx.isAnimating()) {
|
|
634
775
|
bend = 0;
|
|
@@ -656,7 +797,7 @@ var webglRenderer = (options = {}) => ({
|
|
|
656
797
|
);
|
|
657
798
|
ctx.addTeardown(
|
|
658
799
|
ctx.on("dragstart", () => {
|
|
659
|
-
takeCapture
|
|
800
|
+
queueMicrotask(takeCapture);
|
|
660
801
|
wake();
|
|
661
802
|
})
|
|
662
803
|
);
|
|
@@ -673,6 +814,14 @@ var webglRenderer = (options = {}) => ({
|
|
|
673
814
|
subtree: true,
|
|
674
815
|
characterData: true
|
|
675
816
|
});
|
|
817
|
+
const geometryObserver = new MutationObserver(() => {
|
|
818
|
+
if (!ctx.isDragging()) paint();
|
|
819
|
+
wake();
|
|
820
|
+
});
|
|
821
|
+
geometryObserver.observe(element, {
|
|
822
|
+
attributes: true,
|
|
823
|
+
attributeFilter: ["style"]
|
|
824
|
+
});
|
|
676
825
|
const refreshSurfaceStyle = () => {
|
|
677
826
|
if (disposed) return;
|
|
678
827
|
element.style.background = painted.background;
|
|
@@ -691,6 +840,7 @@ var webglRenderer = (options = {}) => ({
|
|
|
691
840
|
paint();
|
|
692
841
|
return () => {
|
|
693
842
|
contentObserver.disconnect();
|
|
843
|
+
geometryObserver.disconnect();
|
|
694
844
|
window.removeEventListener("resize", onResize);
|
|
695
845
|
window.removeEventListener("scroll", onResize);
|
|
696
846
|
teardown();
|