Skip to content

Commit a44f0e8

Browse files
committed
use wheel-equivalent constraint logic for pinch zoom
1 parent 00e5468 commit a44f0e8

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/views/darkroom.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3748,8 +3748,8 @@ gboolean gesture_pinch(dt_view_t *self,
37483748
const int state)
37493749
{
37503750
dt_develop_t *dev = self->data;
3751-
(void)state;
37523751
if(!dev) return FALSE;
3752+
const gboolean constrained = !dt_modifier_is(state, GDK_CONTROL_MASK);
37533753

37543754
static double pinch_last_scale = 0.0;
37553755

@@ -3771,12 +3771,12 @@ gboolean gesture_pinch(dt_view_t *self,
37713771

37723772
if(scale > pinch_last_scale)
37733773
{
3774-
dt_dev_zoom_move(&dev->full, DT_ZOOM_SCROLL, 0.0f, 1, x, y, TRUE);
3774+
dt_dev_zoom_move(&dev->full, DT_ZOOM_SCROLL, 0.0f, 1, x, y, constrained);
37753775
pinch_last_scale = scale;
37763776
}
37773777
else if(scale < pinch_last_scale)
37783778
{
3779-
dt_dev_zoom_move(&dev->full, DT_ZOOM_SCROLL, 0.0f, 0, x, y, TRUE);
3779+
dt_dev_zoom_move(&dev->full, DT_ZOOM_SCROLL, 0.0f, 0, x, y, constrained);
37803780
pinch_last_scale = scale;
37813781
}
37823782

0 commit comments

Comments
 (0)