This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/components/views/elements Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -32,13 +32,14 @@ import dis from '../../../dispatcher/dispatcher';
3232import { replaceableComponent } from "../../../utils/replaceableComponent" ;
3333import { RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"
3434import { MatrixEvent } from "matrix-js-sdk/src/models/event" ;
35+ import { normalizeWheelEvent } from "../../../utils/Mouse" ;
3536
3637const MIN_ZOOM = 100 ;
3738const MAX_ZOOM = 300 ;
3839// This is used for the buttons
3940const ZOOM_STEP = 10 ;
4041// This is used for mouse wheel events
41- const ZOOM_COEFFICIENT = 7 .5;
42+ const ZOOM_COEFFICIENT = 0 .5;
4243// If we have moved only this much we can zoom
4344const ZOOM_DISTANCE = 10 ;
4445
@@ -115,7 +116,9 @@ export default class ImageView extends React.Component<IProps, IState> {
115116 private onWheel = ( ev : WheelEvent ) => {
116117 ev . stopPropagation ( ) ;
117118 ev . preventDefault ( ) ;
118- const newZoom = this . state . zoom - ( ev . deltaY * ZOOM_COEFFICIENT ) ;
119+
120+ const { deltaY} = normalizeWheelEvent ( ev ) ;
121+ const newZoom = this . state . zoom - ( deltaY * ZOOM_COEFFICIENT ) ;
119122
120123 if ( newZoom <= MIN_ZOOM ) {
121124 this . setState ( {
You can’t perform that action at this time.
0 commit comments