Remove the need to press ctrl while zooming

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2020-12-20 20:09:01 +01:00
parent 776b0e8198
commit f0abd52130

View file

@ -79,23 +79,21 @@ export default class ImageView extends React.Component {
};
onWheel = (ev) => {
if (ev.ctrlKey) {
ev.stopPropagation();
ev.preventDefault();
const newZoom =this.state.zoom - ev.deltaY;
ev.stopPropagation();
ev.preventDefault();
const newZoom =this.state.zoom - ev.deltaY;
if (newZoom <= 100) {
this.setState({
zoom: 100,
translationX: 0,
translationY: 0,
});
return;
}
if (newZoom <= 100) {
this.setState({
zoom: newZoom,
zoom: 100,
translationX: 0,
translationY: 0,
});
return;
}
this.setState({
zoom: newZoom,
});
}
onRedactClick = () => {