You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Chrome typing becomes progressively slower as the document gets longer.
Some obvious improvements:
The canvas is sized large enough for the whole document, which is unnecessary. We only need to create a canvas large enough for the visible viewport of the scrollable area, and so we can search for the first line that needs drawing and stop after the last one. On scroll events, we'd move the canvas to appear in the right place and repaint it.
The wrapping could also be optimised so it stops at the next newline and merely adjusts the y positions of the existing lines below.
The text was updated successfully, but these errors were encountered:
Partially implemented - the canvas now is viewport-sized and moves to stay in view as the user scrolls. This alone means that in Chrome you can have a 70,000+ word document (virtual document height of 100,000+ pixels) and scrolling and text selection is still instantaneous. For comparison, a thesis might be 60,000 words, a novel 100,000.
Typing is pretty slow because of the unnecessary wrapping of the whole document on every insert, hence leaving this issue open to implement the second part at some point.
In Chrome typing becomes progressively slower as the document gets longer.
Some obvious improvements:
The text was updated successfully, but these errors were encountered: