animot-presenter 0.5.20 → 0.5.21
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/dist/AnimotPresenter.svelte +22 -13
- package/dist/cdn/animot-presenter.esm.js +1056 -1056
- package/dist/cdn/animot-presenter.min.js +8 -8
- package/package.json +1 -1
|
@@ -391,23 +391,32 @@
|
|
|
391
391
|
* borderRadius / fontSize / shape colors / stroke width / CSS filters
|
|
392
392
|
* at render time, plus non-tweened overrides (backgroundColor, color).
|
|
393
393
|
*/
|
|
394
|
+
/**
|
|
395
|
+
* Overlay tween-driven values for properties that the renderer reads
|
|
396
|
+
* directly from element data (instead of via tween.current). Only
|
|
397
|
+
* applies when this element has keyframes OR has an active override —
|
|
398
|
+
* for everything else this is a passthrough so the existing slide-morph
|
|
399
|
+
* render pipeline is left exactly as it was. Without this gate, every
|
|
400
|
+
* render frame allocated a new copy and crowded out the tween reads.
|
|
401
|
+
*/
|
|
394
402
|
function liveProps<T extends CanvasElement>(element: T): T {
|
|
395
|
-
const
|
|
403
|
+
const hasKeyframes = !!element.keyframes && element.keyframes.length > 0;
|
|
396
404
|
const overrides = keyframeOverrides.get(element.id);
|
|
397
|
-
if (!
|
|
405
|
+
if (!hasKeyframes && !overrides) return element;
|
|
406
|
+
const a = animatedElements.get(element.id) as any;
|
|
398
407
|
const e = element as any;
|
|
399
408
|
const out: any = { ...element };
|
|
400
|
-
if (a) {
|
|
401
|
-
if (
|
|
402
|
-
if (
|
|
403
|
-
if (
|
|
404
|
-
if (
|
|
405
|
-
if (
|
|
406
|
-
if (
|
|
407
|
-
if (
|
|
408
|
-
if (
|
|
409
|
-
if (
|
|
410
|
-
if (
|
|
409
|
+
if (a && hasKeyframes) {
|
|
410
|
+
if (a.borderRadius && e.borderRadius !== undefined) out.borderRadius = a.borderRadius.current;
|
|
411
|
+
if (a.fontSize && e.fontSize !== undefined) out.fontSize = a.fontSize.current;
|
|
412
|
+
if (a.fillColor && e.fillColor !== undefined) out.fillColor = a.fillColor.current;
|
|
413
|
+
if (a.strokeColor && e.strokeColor !== undefined) out.strokeColor = a.strokeColor.current;
|
|
414
|
+
if (a.strokeWidth && e.strokeWidth !== undefined) out.strokeWidth = a.strokeWidth.current;
|
|
415
|
+
if (a.blur && e.blur !== undefined) out.blur = a.blur.current;
|
|
416
|
+
if (a.brightness && e.brightness !== undefined) out.brightness = a.brightness.current;
|
|
417
|
+
if (a.contrast && e.contrast !== undefined) out.contrast = a.contrast.current;
|
|
418
|
+
if (a.saturate && e.saturate !== undefined) out.saturate = a.saturate.current;
|
|
419
|
+
if (a.grayscale && e.grayscale !== undefined) out.grayscale = a.grayscale.current;
|
|
411
420
|
}
|
|
412
421
|
if (overrides) Object.assign(out, overrides);
|
|
413
422
|
return out as T;
|