83 Zoom-to-fit Padding. 83 of 95.

83/CAMERA BEHAVIOR/83 of 95

Zoom-to-fit Padding

Framing leaves intentional breathing room.

Best experienced with a pointer.

The problem

Fit-to-view zooms so tightly that content kisses the edges and feels cramped or clipped by chrome.

The solution

Padding insets the fitted bounds so content sits comfortably inside the view.

Experiment

Play with the values

24px
1

How it works

  • The content's bounds are measured in world space before any camera change.
  • The viewport is inset by padding so the fit target is smaller than the full frame.
  • Scale is computed to fit those bounds inside the inset, not against the raw edges.
  • The content is centered in the remaining view.
  • The camera transform applies that scale and translation together.

Seen in

Diagram fit

Flowcharts zoom to show the whole graph with margin around nodes and edges.

Photo framing

Fit-to-window leaves a thin border so images do not collide with window chrome.

Board overview

Infinite canvases frame selected frames with breathing room for handles and labels.

PDF viewers

Page fit includes padding so page edges stay readable against the viewer background.

References