Auto center and fit in window