@strategicprojects/rpic 0.4.0 → 0.4.1

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/index.js CHANGED
@@ -94,6 +94,17 @@ export function animate(root, animations, gsap) {
94
94
  function drawOn(group, a, tl) {
95
95
  const els = group.querySelectorAll('path, polyline, line, rect, circle, ellipse, polygon');
96
96
  els.forEach((el) => {
97
+ // Filled, unstroked elements (arrowheads) can't be dash-traced — pop
98
+ // them in as the shaft reaches the tip instead.
99
+ const fill = el.getAttribute('fill');
100
+ if (el.getAttribute('stroke-width') === '0' || (fill && fill !== 'none' && !el.getAttribute('stroke'))) {
101
+ tl.from(
102
+ el,
103
+ { opacity: 0, scale: 0, transformOrigin: '50% 50%', duration: Math.min(0.2, a.duration * 0.4), ease: 'back.out(1.7)' },
104
+ a.start + a.duration * 0.8
105
+ );
106
+ return;
107
+ }
97
108
  let len = 0;
98
109
  try {
99
110
  len = el.getTotalLength();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strategicprojects/rpic",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "The pic graphics language compiled to SVG with animation manifests, via WebAssembly. Browser + Node.",
5
5
  "type": "module",
6
6
  "main": "./index.js",
Binary file