Utilities for managing components.
return null if the rectangle is visible, or a new rectangle where it should be moved if it is not.