mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-05 05:38:41 +03:00
Add ZOOM_COEFFICIENT with value of 10
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
7b6d393754
commit
e45035582d
1 changed files with 4 additions and 1 deletions
|
@ -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({
|
||||||
|
|
Loading…
Reference in a new issue