ui.MainWindow: ensure figure does not exceed screen size