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.
@@ -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 a = animatedElements.get(element.id);
403
+ const hasKeyframes = !!element.keyframes && element.keyframes.length > 0;
396
404
  const overrides = keyframeOverrides.get(element.id);
397
- if (!a && !overrides) return element;
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 ((a as any).borderRadius && e.borderRadius !== undefined) out.borderRadius = (a as any).borderRadius.current;
402
- if ((a as any).fontSize && e.fontSize !== undefined) out.fontSize = (a as any).fontSize.current;
403
- if ((a as any).fillColor && e.fillColor !== undefined) out.fillColor = (a as any).fillColor.current;
404
- if ((a as any).strokeColor && e.strokeColor !== undefined) out.strokeColor = (a as any).strokeColor.current;
405
- if ((a as any).strokeWidth && e.strokeWidth !== undefined) out.strokeWidth = (a as any).strokeWidth.current;
406
- if ((a as any).blur && e.blur !== undefined) out.blur = (a as any).blur.current;
407
- if ((a as any).brightness && e.brightness !== undefined) out.brightness = (a as any).brightness.current;
408
- if ((a as any).contrast && e.contrast !== undefined) out.contrast = (a as any).contrast.current;
409
- if ((a as any).saturate && e.saturate !== undefined) out.saturate = (a as any).saturate.current;
410
- if ((a as any).grayscale && e.grayscale !== undefined) out.grayscale = (a as any).grayscale.current;
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;