Modified algorithm to allow highlighter to leave scrollable views.