diff --git a/src/util.rs b/src/util.rs
index 6cb5524..fb033eb 100644
--- a/src/util.rs
+++ b/src/util.rs
@@ -166,3 +166,10 @@ pub enum Direction {
Back,
Forward,
}
+
+#[derive(Copy, Clone, Debug)]
+pub enum Gesture {
+ /// Rotate with threshold offset
+ Rotate(f64),
+ Scale,
+}
diff --git a/src/widgets/image.rs b/src/widgets/image.rs
index b2f5066..b432980 100644
--- a/src/widgets/image.rs
+++ b/src/widgets/image.rs
@@ -33,6 +33,7 @@ use crate::decoder::tiling::FrameBufferExt;
use crate::decoder::{self, tiling, Decoder, DecoderUpdate};
use crate::i18n::i18n;
use crate::image_metadata::LpImageMetadata;
+use crate::util::Gesture;
use adw::{prelude::*, subclass::prelude::*};
use arc_swap::ArcSwap;
@@ -65,7 +66,12 @@ const ZOOM_FACTOR_DOUBLE_TAP: f64 = 2.5;
/// Relative to best-fit and `MAX_ZOOM_LEVEL`
const ZOOM_FACTOR_MAX_RUBBERBAND: f64 = 2.;
/// Smaller values make the band feel stiffer
-const RUBBERBANDING_EXPONENT: f64 = 0.4;
+const RUBBERBANDING_EXPONENT: f64 = 0.3;
+
+/// When this scale factor is reached, rotate is deactivated
+const ZOOM_GESTURE_LOCK_THRESHOLD: f64 = 1.2;
+/// When this rotate angle is reached, zoom is deactivated
+const ROTATE_GESTURE_LOCK_THRESHOLD: f64 = 15.;
/// Max zoom level 2000%
const MAX_ZOOM_LEVEL: f64 = 20.0;
@@ -140,9 +146,14 @@ mod imp {
/// Required for calculating delta while moving window around
pub(super) last_drag_value: Cell