Add ZOOM_COEFFICIENT with value of 10

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
pull/21833/head
Š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
1 changed files with 4 additions and 1 deletions

View File

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