Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #5872 from SimonBrandner/new-image-view-fixes
Browse files Browse the repository at this point in the history
New Image View fixes/improvements
  • Loading branch information
jryans authored Apr 19, 2021
2 parents 01fc88f + 2e31355 commit 2d1615e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/views/elements/ImageView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ 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;
const ZOOM_COEFFICIENT = 7.5;
// If we have moved only this much we can zoom
const ZOOM_DISTANCE = 10;

Expand Down Expand Up @@ -209,6 +209,10 @@ export default class ImageView extends React.Component<IProps, IState> {
ev.stopPropagation();
ev.preventDefault();

// Don't do anything if we pressed any
// other button than the left one
if (ev.button !== 0) return;

// Zoom in if we are completely zoomed out
if (this.state.zoom === MIN_ZOOM) {
this.setState({zoom: MAX_ZOOM});
Expand Down

0 comments on commit 2d1615e

Please sign in to comment.