animejs 4.2.1 → 4.2.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/dist/bundles/anime.esm.js +12 -8
- package/dist/bundles/anime.esm.min.js +2 -2
- package/dist/bundles/anime.umd.js +12 -8
- package/dist/bundles/anime.umd.min.js +2 -2
- package/dist/modules/animatable/animatable.cjs +1 -1
- package/dist/modules/animatable/animatable.js +1 -1
- package/dist/modules/animatable/index.cjs +1 -1
- package/dist/modules/animatable/index.js +1 -1
- package/dist/modules/animation/additive.cjs +1 -1
- package/dist/modules/animation/additive.js +1 -1
- package/dist/modules/animation/animation.cjs +1 -1
- package/dist/modules/animation/animation.js +1 -1
- package/dist/modules/animation/composition.cjs +1 -1
- package/dist/modules/animation/composition.js +1 -1
- package/dist/modules/animation/index.cjs +1 -1
- package/dist/modules/animation/index.js +1 -1
- package/dist/modules/core/clock.cjs +1 -1
- package/dist/modules/core/clock.js +1 -1
- package/dist/modules/core/colors.cjs +1 -1
- package/dist/modules/core/colors.js +1 -1
- package/dist/modules/core/consts.cjs +1 -1
- package/dist/modules/core/consts.js +1 -1
- package/dist/modules/core/globals.cjs +2 -2
- package/dist/modules/core/globals.js +2 -2
- package/dist/modules/core/helpers.cjs +1 -1
- package/dist/modules/core/helpers.js +1 -1
- package/dist/modules/core/render.cjs +1 -1
- package/dist/modules/core/render.js +1 -1
- package/dist/modules/core/styles.cjs +1 -1
- package/dist/modules/core/styles.js +1 -1
- package/dist/modules/core/targets.cjs +1 -1
- package/dist/modules/core/targets.js +1 -1
- package/dist/modules/core/transforms.cjs +1 -1
- package/dist/modules/core/transforms.js +1 -1
- package/dist/modules/core/units.cjs +1 -1
- package/dist/modules/core/units.js +1 -1
- package/dist/modules/core/values.cjs +1 -1
- package/dist/modules/core/values.js +1 -1
- package/dist/modules/draggable/draggable.cjs +1 -1
- package/dist/modules/draggable/draggable.js +1 -1
- package/dist/modules/draggable/index.cjs +1 -1
- package/dist/modules/draggable/index.js +1 -1
- package/dist/modules/easings/cubic-bezier/index.cjs +1 -1
- package/dist/modules/easings/cubic-bezier/index.js +1 -1
- package/dist/modules/easings/eases/index.cjs +1 -1
- package/dist/modules/easings/eases/index.js +1 -1
- package/dist/modules/easings/eases/parser.cjs +1 -1
- package/dist/modules/easings/eases/parser.js +1 -1
- package/dist/modules/easings/index.cjs +1 -1
- package/dist/modules/easings/index.js +1 -1
- package/dist/modules/easings/irregular/index.cjs +1 -1
- package/dist/modules/easings/irregular/index.js +1 -1
- package/dist/modules/easings/linear/index.cjs +1 -1
- package/dist/modules/easings/linear/index.js +1 -1
- package/dist/modules/easings/none.cjs +1 -1
- package/dist/modules/easings/none.js +1 -1
- package/dist/modules/easings/spring/index.cjs +1 -1
- package/dist/modules/easings/spring/index.js +1 -1
- package/dist/modules/easings/steps/index.cjs +1 -1
- package/dist/modules/easings/steps/index.js +1 -1
- package/dist/modules/engine/engine.cjs +1 -1
- package/dist/modules/engine/engine.js +1 -1
- package/dist/modules/engine/index.cjs +1 -1
- package/dist/modules/engine/index.js +1 -1
- package/dist/modules/events/index.cjs +1 -1
- package/dist/modules/events/index.js +1 -1
- package/dist/modules/events/scroll.cjs +1 -1
- package/dist/modules/events/scroll.js +1 -1
- package/dist/modules/index.cjs +1 -1
- package/dist/modules/index.js +1 -1
- package/dist/modules/scope/index.cjs +1 -1
- package/dist/modules/scope/index.js +1 -1
- package/dist/modules/scope/scope.cjs +1 -1
- package/dist/modules/scope/scope.js +1 -1
- package/dist/modules/svg/drawable.cjs +1 -1
- package/dist/modules/svg/drawable.js +1 -1
- package/dist/modules/svg/helpers.cjs +1 -1
- package/dist/modules/svg/helpers.js +1 -1
- package/dist/modules/svg/index.cjs +1 -1
- package/dist/modules/svg/index.js +1 -1
- package/dist/modules/svg/morphto.cjs +1 -1
- package/dist/modules/svg/morphto.js +1 -1
- package/dist/modules/svg/motionpath.cjs +11 -7
- package/dist/modules/svg/motionpath.js +11 -7
- package/dist/modules/text/index.cjs +1 -1
- package/dist/modules/text/index.js +1 -1
- package/dist/modules/text/split.cjs +1 -1
- package/dist/modules/text/split.js +1 -1
- package/dist/modules/timeline/index.cjs +1 -1
- package/dist/modules/timeline/index.js +1 -1
- package/dist/modules/timeline/position.cjs +1 -1
- package/dist/modules/timeline/position.js +1 -1
- package/dist/modules/timeline/timeline.cjs +1 -1
- package/dist/modules/timeline/timeline.js +1 -1
- package/dist/modules/timer/index.cjs +1 -1
- package/dist/modules/timer/index.js +1 -1
- package/dist/modules/timer/timer.cjs +1 -1
- package/dist/modules/timer/timer.js +1 -1
- package/dist/modules/utils/chainable.cjs +1 -1
- package/dist/modules/utils/chainable.js +1 -1
- package/dist/modules/utils/index.cjs +1 -1
- package/dist/modules/utils/index.js +1 -1
- package/dist/modules/utils/number.cjs +1 -1
- package/dist/modules/utils/number.js +1 -1
- package/dist/modules/utils/random.cjs +1 -1
- package/dist/modules/utils/random.js +1 -1
- package/dist/modules/utils/stagger.cjs +1 -1
- package/dist/modules/utils/stagger.js +1 -1
- package/dist/modules/utils/target.cjs +1 -1
- package/dist/modules/utils/target.js +1 -1
- package/dist/modules/utils/time.cjs +1 -1
- package/dist/modules/utils/time.js +1 -1
- package/dist/modules/waapi/composition.cjs +1 -1
- package/dist/modules/waapi/composition.js +1 -1
- package/dist/modules/waapi/index.cjs +1 -1
- package/dist/modules/waapi/index.js +1 -1
- package/dist/modules/waapi/waapi.cjs +1 -1
- package/dist/modules/waapi/waapi.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Anime.js - svg - ESM
|
|
3
|
-
* @version v4.2.
|
|
3
|
+
* @version v4.2.2
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2025 - Julian Garnier
|
|
6
6
|
*/
|
|
@@ -24,12 +24,15 @@ import { getPath } from './helpers.js';
|
|
|
24
24
|
* @param {SVGGeometryElement} $path
|
|
25
25
|
* @param {Number} totalLength
|
|
26
26
|
* @param {Number} progress
|
|
27
|
-
* @param {Number}lookup
|
|
27
|
+
* @param {Number} lookup
|
|
28
|
+
* @param {Boolean} shouldClamp
|
|
28
29
|
* @return {DOMPoint}
|
|
29
30
|
*/
|
|
30
|
-
const getPathPoint = ($path, totalLength, progress, lookup
|
|
31
|
+
const getPathPoint = ($path, totalLength, progress, lookup, shouldClamp) => {
|
|
31
32
|
const point = progress + lookup;
|
|
32
|
-
const pointOnPath =
|
|
33
|
+
const pointOnPath = shouldClamp
|
|
34
|
+
? Math.max(0, Math.min(point, totalLength)) // Clamp between 0 and totalLength
|
|
35
|
+
: (point % totalLength + totalLength) % totalLength; // Wrap around
|
|
33
36
|
return $path.getPointAtLength(pointOnPath);
|
|
34
37
|
};
|
|
35
38
|
|
|
@@ -44,6 +47,7 @@ const getPathProgess = ($path, pathProperty, offset = 0) => {
|
|
|
44
47
|
const totalLength = +($path.getTotalLength());
|
|
45
48
|
const inSvg = $el[isSvgSymbol];
|
|
46
49
|
const ctm = $path.getCTM();
|
|
50
|
+
const shouldClamp = offset === 0;
|
|
47
51
|
/** @type {TweenObjectValue} */
|
|
48
52
|
return {
|
|
49
53
|
from: 0,
|
|
@@ -53,11 +57,11 @@ const getPathProgess = ($path, pathProperty, offset = 0) => {
|
|
|
53
57
|
const offsetLength = offset * totalLength;
|
|
54
58
|
const newProgress = progress + offsetLength;
|
|
55
59
|
if (pathProperty === 'a') {
|
|
56
|
-
const p0 = getPathPoint($path, totalLength, newProgress, -1);
|
|
57
|
-
const p1 = getPathPoint($path, totalLength, newProgress, 1);
|
|
60
|
+
const p0 = getPathPoint($path, totalLength, newProgress, -1, shouldClamp);
|
|
61
|
+
const p1 = getPathPoint($path, totalLength, newProgress, 1, shouldClamp);
|
|
58
62
|
return atan2(p1.y - p0.y, p1.x - p0.x) * 180 / PI;
|
|
59
63
|
} else {
|
|
60
|
-
const p = getPathPoint($path, totalLength, newProgress, 0);
|
|
64
|
+
const p = getPathPoint($path, totalLength, newProgress, 0, shouldClamp);
|
|
61
65
|
return pathProperty === 'x' ?
|
|
62
66
|
inSvg || !ctm ? p.x : p.x * ctm.a + p.y * ctm.c + ctm.e :
|
|
63
67
|
inSvg || !ctm ? p.y : p.x * ctm.b + p.y * ctm.d + ctm.f
|