bugfix: clamp scroll offsets
Merge pull request #799 from chrox/new_ui_code

bugfix: clamp scroll offsets