Skip to content

Commit c77c302

Browse files
authored
Merge pull request #240 from Kalo0m/feat/translation-Ken-Burns
feat: translations ken Burns
2 parents 4346454 + aa5f7d1 commit c77c302

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sources/fabric/fabricFrameSources.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const loadImage = async (pathOrUrl) => new Promise((resolve) => fabric.util.load
1414

1515
function getZoomParams({ progress, zoomDirection, zoomAmount }) {
1616
let scaleFactor = 1;
17-
if (zoomDirection === 'left' || zoomDirection === 'right') return 1.3;
17+
if (zoomDirection === 'left' || zoomDirection === 'right') return 1.3 + zoomAmount;
1818
if (zoomDirection === 'in') scaleFactor = (1 + zoomAmount * progress);
1919
else if (zoomDirection === 'out') scaleFactor = (1 + zoomAmount * (1 - progress));
2020
return scaleFactor;
@@ -25,7 +25,7 @@ function getTranslationParams({ progress, zoomDirection, zoomAmount }) {
2525
const range = zoomAmount * 1000;
2626

2727
if (zoomDirection === 'right') translation = (progress) * range - range / 2;
28-
else if (zoomDirection === 'left') translation = (100 - progress * 100) * range - range / 2;
28+
else if (zoomDirection === 'left') translation = -((progress) * range - range / 2);
2929

3030
return translation;
3131
}

0 commit comments

Comments
 (0)