UA-eMath / eMath

new eMath system
2 stars 0 forks source link

jitter during editing #144

Closed bohungi closed 3 years ago

bohungi commented 3 years ago

During editing, the page jumps frequently up and down; the more material there is on a page, the greater the jump amplitude near its bottom. This forces me to frequently visually redetect what I am doing. It slows me down a fair bit, and it causes eyestrain.

It would be great if the page view could be stable (as it is when I writing into github what I am writing now).

If overcoming these jumps is difficult, it would be best if we could discuss options.

xqiu1 commented 3 years ago

After trying many different ways, I found this problem is not easy to solve... I make small changes in the end, hope to reduce some jumps. The reason for the difficulty is that all latex-related content on the page rerender when the content of the input area changes. Before the rerender process finished, the height of the display area on the right gets smaller, so you feel the page jumps up and down. I thought of a workaround that is making the display area always has the same height as the input area on the left. This way, although the latex will still be constantly refreshed, it will not affect the height of the entire display area. What do you think of it?

bohungi commented 3 years ago

Depending on the content, sometimes the editor window will be bigger than the display window on the right. Sometimes it will be the other way around (for example, if a picture is loaded).

If pinning the size of the display window to the size of the editor window would eliminate the jitter problem, perhaps a workable compromise is to make the editor window a taller than it needs to be, and then use that height for the display window as well. This way all edit situations, except for rare cases where the display window is a lot taller than the edit window, would be handled well.

If this approach is workable, we could determine by trial and error how much taller than needed the editor window should be for good results.

xqiu1 commented 3 years ago

Good news!!! I managed to implement that only the latex code of the paragraph the user is typing will rerender, while the rest of the unmodified content will not trigger the rerendering.

bohungi commented 3 years ago

I tried it just now ... and the improvement is fantastic. Thank you! and congratulations!!!!