Closed LinqLover closed 1 month ago
Here is another observation that is possibly linked to or caused by the above, so I will post it here, but of course it can still be moved into a different issue:
% !TeX root = test.tex
\documentclass{scrbook}
\usepackage{blindtext}
\usepackage{pdflscape}
\begin{document}
\blindtext
\clearpage
\blindtext
\clearpage
\blindtext
\clearpage
\blindtext
\clearpage
%\begin{landscape}
\blindtext
%\end{landscape}
\clearpage
\end{document}
landscape
environment-related lines and save to rebuildDistorted during zooming:
This seems to be caused by a strange reason which persists even when the viewer is not in spread mode. I observed this problem when there are multiple pdfs opened and the one being refreshed is not currently in view. To reproduce, compile the tex file (with the pdf hidden) several times with minor changes. Then after clicking on the pdf tab for that file again, one will observe this problem.
It seems that VS Code (or Chrome in general) does some optimization by not letting JS run fully when a tab is not visible. So, the PDF reloading sequence is messed up, and our code injection to delete pages, etc., does not work correctly. When this happens, the new pages are appended, but the old ones aren't deleted.
Meanwhile @tamuratak implemented a very elegant way to remove flicker using a mask with the old content copied and then remove the mask once the page has been loaded. It is much less invasive than what we have now. https://github.com/tamuratak/latex-toybox?tab=readme-ov-file#true-flicker-free-reloading @tamuratak Can we adapt your code? @James-Yu What do you think about replacing what we have with this new implementation?
I am fine with adapting to the new logic as long as license permits. However, I am not working on the viewing part. Would you kindly take the role? @quoc-ho
@James-Yu Great! I'm happy to look into it, but most likely in the winter, after the semester is over. I'm a bit swamped at the moment.
That would be awesome! I’ll check the code shortly and see if it is a large work or not.
@James-Yu I took a look a while ago, and it seems that it's actually less than what we had to do in our implementation.
Great, thank you for all the swift fixes! Can I ask when these changes are usually live in the VS Code Marketplace? :)
Pre-checks*
Environment*
The Issue*
Reproduction Steps
Expected Behavior
Logs
LaTeX Workshop Output*
Developer Tools Console
PDF.js v4.6.82 (build: 9b541910f) Message: Failed to execute 'removeChild' on 'Node': parameter 1 is not of type 'Node'. _otherError @ viewer.mjs:13573 webviewCommands.ts:32 Using standard dev tools to debug iframe based webview viewer.mjs:121 offsetParent is not set -- cannot scroll