fix: consistent use of ZOOM_STEP (#5801)

introduce MIN_ZOOM, consistent use of ZOOM_STEP
This commit is contained in:
zsviczian 2022-10-31 06:23:05 +01:00 committed by GitHub
parent f5379d1563
commit 1e69609ce4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 4 deletions

View file

@ -76,6 +76,7 @@ import {
THEME,
TOUCH_CTX_MENU_TIMEOUT,
VERTICAL_ALIGN,
ZOOM_STEP,
} from "../constants";
import { loadFromBlob } from "../data";
import Library, { distributeLibraryItemsOnSquareGrid } from "../data/library";
@ -6097,7 +6098,7 @@ class App extends React.Component<AppProps, AppState> {
// note that event.ctrlKey is necessary to handle pinch zooming
if (event.metaKey || event.ctrlKey) {
const sign = Math.sign(deltaY);
const MAX_STEP = 10;
const MAX_STEP = ZOOM_STEP * 100;
const absDelta = Math.abs(deltaY);
let delta = deltaY;
if (absDelta > MAX_STEP) {