81 Pinch Focal Point. 81 of 95.
81/CAMERA BEHAVIOR/81 of 95
Pinch Focal Point
Zoom should anchor where the pinch happens.
Best experienced with a pointer.
The problem
Zooming from the viewport center slides content away from the fingers, so the point of interest drifts under the gesture.
The solution
The pinch midpoint stays fixed under the fingers while scale changes.
Experiment
Play with the values
0.5
4
0.002
How it works
- A pinch or wheel zoom needs a point to stay still, not only a scale factor.
- The focal point is the midpoint between the fingers, or the pointer for a wheel.
- That point is converted into content space before the scale changes.
- Scale is applied around the focal point.
- The content under the fingers stays under the fingers after the zoom.
Seen in
Maps
Pinching a street keeps that street under the fingers as scale changes.
Photo viewers
Zoom into a face without the image sliding toward the center.
Design canvases
Wheel-zoom toward the cursor keeps the inspected node fixed.
PDF readers
Pinch on a paragraph keeps that text anchored during zoom.