Skip to content

Commit

Permalink
Merge pull request #240 from Kalo0m/feat/translation-Ken-Burns
Browse files Browse the repository at this point in the history
feat: translations ken Burns
  • Loading branch information
mifi authored Apr 6, 2023
2 parents 4346454 + aa5f7d1 commit c77c302
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sources/fabric/fabricFrameSources.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const loadImage = async (pathOrUrl) => new Promise((resolve) => fabric.util.load

function getZoomParams({ progress, zoomDirection, zoomAmount }) {
let scaleFactor = 1;
if (zoomDirection === 'left' || zoomDirection === 'right') return 1.3;
if (zoomDirection === 'left' || zoomDirection === 'right') return 1.3 + zoomAmount;
if (zoomDirection === 'in') scaleFactor = (1 + zoomAmount * progress);
else if (zoomDirection === 'out') scaleFactor = (1 + zoomAmount * (1 - progress));
return scaleFactor;
Expand All @@ -25,7 +25,7 @@ function getTranslationParams({ progress, zoomDirection, zoomAmount }) {
const range = zoomAmount * 1000;

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

return translation;
}
Expand Down

0 comments on commit c77c302

Please sign in to comment.