Improve the scroll to view port logic

Do minimal scroll when top of the window is out of view

Change-Id: I8a2eb01451961655b651d53763356bd7e0aa5abf