Added scaling algorithm for view.