bugfix: fix loop scrolling at the beginning/end of the document
Merge pull request #796 from chrox/new_ui_code

bugfix: fix loop scrolling at the beginning/end of the document