Made changes to UIPane

Calculates dimension of the pane based on size and layout.