How does zoom to fit calculate the border that is left on the screen?

I would like to zoom to fit or zoom to selection without leaving a border. I intend to use a macro to first zoom to fit and then zoom by a factor that eliminates the border, but I don't know how the border is calculated. Is it a percentage of the model bounding box in the current view?

SolidworksGeneral