Copied new WinForms logic to JS

Scroll and Drawing logic