Skip to content

Touchpad: allow simultaneous smartphone-like pinch zoom and pan gestures in culling layouts#20888

Draft
da-phil wants to merge 2 commits intodarktable-org:masterfrom
da-phil:touchpad_seamless_pinch_zoom_and_pan_in_culling_layouts
Draft

Touchpad: allow simultaneous smartphone-like pinch zoom and pan gestures in culling layouts#20888
da-phil wants to merge 2 commits intodarktable-org:masterfrom
da-phil:touchpad_seamless_pinch_zoom_and_pan_in_culling_layouts

Conversation

@da-phil
Copy link
Copy Markdown
Contributor

@da-phil da-phil commented Apr 27, 2026

This addresses request (e) of issue #20750.

This change allows smartphone-like simultaneous gesture based pinch zooming and panning within the lighttable culling layouts when having two pictures next to each other.
The behavior works as implemented for the darkroom in #20812.

Screencast.from.2026-04-27.16-26-01.mp4

I start this as a draft PR, because it also contains caching code for the culling layout, which made this work much easier and smoother. I'll try to factor out this code into a separate PR.

Disclaimer: this work was co-created with Claude.

@da-phil da-phil force-pushed the touchpad_seamless_pinch_zoom_and_pan_in_culling_layouts branch 3 times, most recently from 848124c to 9206e8d Compare April 28, 2026 15:52
Pinch-zoom and ctrl+scroll in culling re-runs the full mipmap fetch +
color transform on every event, so the gesture stutters even though the
underlying image content does not change.

Cache the native-resolution color-converted mipmap surface per thumbnail
and add a deferred preview path: during a gesture _thumb_draw_image
rescales the existing surface via a cairo transform, and the proper
surface reload is triggered once the gesture finishes via
dt_culling_zoom_end(). Add a smooth-scroll ctrl path so touchpad zoom
feels seamless rather than batched into 0.5-unit steps.

The bound formulas in _zoom_to_center, _event_motion_notify,
dt_culling_pan_move and dt_thumbnail_image_refresh_position now derive
from thumb->zoom directly so they stay correct while the surface still
shows the gesture-start zoom.
@da-phil da-phil force-pushed the touchpad_seamless_pinch_zoom_and_pan_in_culling_layouts branch from 9206e8d to e597dde Compare April 28, 2026 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant