generic algorithm for sizing and overlays:

The toy ui is helping make this easier to test.