Add ZOOM_COEFFICIENT with value of 10

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2021-03-15 19:28:21 +01:00
parent 7b6d393754
commit e45035582d
No known key found for this signature in database
GPG key ID: 9760693FDD98A790

View file

@ -33,7 +33,10 @@ import {replaceableComponent} from "../../../utils/replaceableComponent";
const MIN_ZOOM = 100;
const MAX_ZOOM = 300;
// This is used for the buttons
const ZOOM_STEP = 10;
// This is used for mouse wheel events
const ZOOM_COEFFICIENT = 10;
@replaceableComponent("views.elements.ImageView")
export default class ImageView extends React.Component {
@ -93,7 +96,7 @@ export default class ImageView extends React.Component {
onWheel = (ev) => {
ev.stopPropagation();
ev.preventDefault();
const newZoom = this.state.zoom - ev.deltaY;
const newZoom = this.state.zoom - (ev.deltaY * ZOOM_COEFFICIENT);
if (newZoom <= MIN_ZOOM) {
this.setState({