ui.CenterViewport Edit

void ui.CenterViewport()
Centers the viewport.
V1 Function Name
New to V2

ui.CenterViewport centers the protein in the Foldit window.

The effect is similar to the keyboard shortcut "q", or the home key on Windows. Generally, if the protein is off the screen, ui.CenterViewport moves it back into view.

Another way to look at it is to assume the protein remains stationary, and a camera moves around it, with the camera's view displayed on the screen.

If the protein is somewhere in front of the camera, ui.CenterViewport rotates the camera so that it is pointing at the center of the smallest box that can enclose the protein. The function does not adjust the distance of the camera from the protein. The protein may not fit the screen. If the protein is behind the camera, the camera may dolly back until the protein appears...or it may not. (The center of the protein's "bounding box" may be in view, but it may be in empty space.)