function clampState({
  state,
  minContentLength,
  maxContentLength,
  containerLength,
}: {
  state: ScrollState,
  minContentLength: number,
  maxContentLength: number,
  containerLength: number,
}): ScrollState {
  return clampOffset(
    clampLength({
      state,
      minContentLength,
      maxContentLength,
      containerLength,
    }),
    containerLength,
  );
}
Returns `state` clamped such that:
- `length`: you won't be able to zoom in/out such that the content is
  shorter than the `containerLength`.
- `offset`: content remains in `containerLength`.