Skip to content

Commit e8117f6

Browse files
authored
fix: 🐛 inaccurate calculation in target scale (#367)
1 parent 72fd37e commit e8117f6

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/core/handlers/handlers.utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const handleCalculateButtonZoom = (
2424
throw new Error("Wrapper is not mounted");
2525
}
2626

27-
const targetScale = scale * Math.exp(delta * step);
27+
const targetScale = scale + delta * step;
2828

2929
const newScale = checkZoomBounds(
3030
roundNumber(targetScale, 3),

src/core/wheel/wheel.utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export const handleCalculateWheelZoom = (
8686
throw new Error("Wrapper is not mounted");
8787
}
8888

89-
const targetScale = scale + delta * (scale - scale * step) * step;
89+
const targetScale = scale + delta * step;
9090

9191
if (getTarget) return targetScale;
9292
const paddingEnabled = disable ? false : !disabled;

0 commit comments

Comments
 (0)