added logic for view width/height interpretation