Dynamic centering of veiwpanel