I18n example (#33)

* feat: i18n pt 1

* fix: prevent float calculations when updating dimensions
This commit is contained in:
Ben Warzeski
2022-03-17 14:08:46 -04:00
committed by GitHub
parent a79da4cb2d
commit 3b8a7780ac
18 changed files with 160 additions and 94 deletions

View File

@@ -59,8 +59,8 @@ export const getValidDimensions = ({
// if closest valid iteration is current iteration, move one iteration in the change direction
if (iter === (dimensions[keys.changed] / minInc[keys.changed])) { iter += direction; }
out[keys.changed] = iter * minInc[keys.changed];
out[keys.other] = out[keys.changed] * (locked[keys.other] / locked[keys.changed]);
out[keys.changed] = Math.round(iter * minInc[keys.changed]);
out[keys.other] = Math.round(out[keys.changed] * (locked[keys.other] / locked[keys.changed]));
return out;
};