Skip to content

Commit ae41389

Browse files
committed
v4.2.2
1 parent 1bfdb09 commit ae41389

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+175
-155
lines changed

dist/bundles/anime.esm.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Anime.js - ESM bundle
3-
* @version v4.2.1
3+
* @version v4.2.2
44
* @license MIT
55
* @copyright 2025 - Julian Garnier
66
*/
@@ -796,7 +796,7 @@ const globals = {
796796
tickThreshold: 200,
797797
};
798798

799-
const globalVersions = { version: '4.2.1', engine: null };
799+
const globalVersions = { version: '4.2.2', engine: null };
800800

801801
if (isBrowser) {
802802
if (!win.AnimeJS) win.AnimeJS = [];
@@ -7655,12 +7655,15 @@ const getPath = path => {
76557655
* @param {SVGGeometryElement} $path
76567656
* @param {Number} totalLength
76577657
* @param {Number} progress
7658-
* @param {Number}lookup
7658+
* @param {Number} lookup
7659+
* @param {Boolean} shouldClamp
76597660
* @return {DOMPoint}
76607661
*/
7661-
const getPathPoint = ($path, totalLength, progress, lookup = 0) => {
7662+
const getPathPoint = ($path, totalLength, progress, lookup, shouldClamp) => {
76627663
const point = progress + lookup;
7663-
const pointOnPath = (point % totalLength + totalLength) % totalLength;
7664+
const pointOnPath = shouldClamp
7665+
? Math.max(0, Math.min(point, totalLength)) // Clamp between 0 and totalLength
7666+
: (point % totalLength + totalLength) % totalLength; // Wrap around
76647667
return $path.getPointAtLength(pointOnPath);
76657668
};
76667669

@@ -7675,6 +7678,7 @@ const getPathProgess = ($path, pathProperty, offset = 0) => {
76757678
const totalLength = +($path.getTotalLength());
76767679
const inSvg = $el[isSvgSymbol];
76777680
const ctm = $path.getCTM();
7681+
const shouldClamp = offset === 0;
76787682
/** @type {TweenObjectValue} */
76797683
return {
76807684
from: 0,
@@ -7684,11 +7688,11 @@ const getPathProgess = ($path, pathProperty, offset = 0) => {
76847688
const offsetLength = offset * totalLength;
76857689
const newProgress = progress + offsetLength;
76867690
if (pathProperty === 'a') {
7687-
const p0 = getPathPoint($path, totalLength, newProgress, -1);
7688-
const p1 = getPathPoint($path, totalLength, newProgress, 1);
7691+
const p0 = getPathPoint($path, totalLength, newProgress, -1, shouldClamp);
7692+
const p1 = getPathPoint($path, totalLength, newProgress, 1, shouldClamp);
76897693
return atan2(p1.y - p0.y, p1.x - p0.x) * 180 / PI;
76907694
} else {
7691-
const p = getPathPoint($path, totalLength, newProgress, 0);
7695+
const p = getPathPoint($path, totalLength, newProgress, 0, shouldClamp);
76927696
return pathProperty === 'x' ?
76937697
inSvg || !ctm ? p.x : p.x * ctm.a + p.y * ctm.c + ctm.e :
76947698
inSvg || !ctm ? p.y : p.x * ctm.b + p.y * ctm.d + ctm.f

dist/bundles/anime.esm.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/bundles/anime.umd.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Anime.js - UMD bundle
3-
* @version v4.2.1
3+
* @version v4.2.2
44
* @license MIT
55
* @copyright 2025 - Julian Garnier
66
*/
@@ -802,7 +802,7 @@
802802
tickThreshold: 200,
803803
};
804804

805-
const globalVersions = { version: '4.2.1', engine: null };
805+
const globalVersions = { version: '4.2.2', engine: null };
806806

807807
if (isBrowser) {
808808
if (!win.AnimeJS) win.AnimeJS = [];
@@ -7661,12 +7661,15 @@
76617661
* @param {SVGGeometryElement} $path
76627662
* @param {Number} totalLength
76637663
* @param {Number} progress
7664-
* @param {Number}lookup
7664+
* @param {Number} lookup
7665+
* @param {Boolean} shouldClamp
76657666
* @return {DOMPoint}
76667667
*/
7667-
const getPathPoint = ($path, totalLength, progress, lookup = 0) => {
7668+
const getPathPoint = ($path, totalLength, progress, lookup, shouldClamp) => {
76687669
const point = progress + lookup;
7669-
const pointOnPath = (point % totalLength + totalLength) % totalLength;
7670+
const pointOnPath = shouldClamp
7671+
? Math.max(0, Math.min(point, totalLength)) // Clamp between 0 and totalLength
7672+
: (point % totalLength + totalLength) % totalLength; // Wrap around
76707673
return $path.getPointAtLength(pointOnPath);
76717674
};
76727675

@@ -7681,6 +7684,7 @@
76817684
const totalLength = +($path.getTotalLength());
76827685
const inSvg = $el[isSvgSymbol];
76837686
const ctm = $path.getCTM();
7687+
const shouldClamp = offset === 0;
76847688
/** @type {TweenObjectValue} */
76857689
return {
76867690
from: 0,
@@ -7690,11 +7694,11 @@
76907694
const offsetLength = offset * totalLength;
76917695
const newProgress = progress + offsetLength;
76927696
if (pathProperty === 'a') {
7693-
const p0 = getPathPoint($path, totalLength, newProgress, -1);
7694-
const p1 = getPathPoint($path, totalLength, newProgress, 1);
7697+
const p0 = getPathPoint($path, totalLength, newProgress, -1, shouldClamp);
7698+
const p1 = getPathPoint($path, totalLength, newProgress, 1, shouldClamp);
76957699
return atan2(p1.y - p0.y, p1.x - p0.x) * 180 / PI;
76967700
} else {
7697-
const p = getPathPoint($path, totalLength, newProgress, 0);
7701+
const p = getPathPoint($path, totalLength, newProgress, 0, shouldClamp);
76987702
return pathProperty === 'x' ?
76997703
inSvg || !ctm ? p.x : p.x * ctm.a + p.y * ctm.c + ctm.e :
77007704
inSvg || !ctm ? p.y : p.x * ctm.b + p.y * ctm.d + ctm.f

dist/bundles/anime.umd.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/modules/animatable/animatable.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Anime.js - animatable - CJS
3-
* @version v4.2.1
3+
* @version v4.2.2
44
* @license MIT
55
* @copyright 2025 - Julian Garnier
66
*/

dist/modules/animatable/animatable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Anime.js - animatable - ESM
3-
* @version v4.2.1
3+
* @version v4.2.2
44
* @license MIT
55
* @copyright 2025 - Julian Garnier
66
*/

dist/modules/animatable/index.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Anime.js - animatable - CJS
3-
* @version v4.2.1
3+
* @version v4.2.2
44
* @license MIT
55
* @copyright 2025 - Julian Garnier
66
*/

dist/modules/animatable/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Anime.js - animatable - ESM
3-
* @version v4.2.1
3+
* @version v4.2.2
44
* @license MIT
55
* @copyright 2025 - Julian Garnier
66
*/

dist/modules/animation/additive.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Anime.js - animation - CJS
3-
* @version v4.2.1
3+
* @version v4.2.2
44
* @license MIT
55
* @copyright 2025 - Julian Garnier
66
*/

dist/modules/animation/additive.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Anime.js - animation - ESM
3-
* @version v4.2.1
3+
* @version v4.2.2
44
* @license MIT
55
* @copyright 2025 - Julian Garnier
66
*/

0 commit comments

Comments
 (0)