typora / typora-issues

Bugs, suggestions or free discussions about the minimal markdown editor — Typora
https://typora.io
1.53k stars 58 forks source link

String not display completely in the mermaid preview on Mac when zoom #5864

Open MarqueIV opened 11 months ago

MarqueIV commented 11 months ago

Issue https://github.com/typora/typora-issues/issues/4499 was closed without being addressed. However, the issue exists even through today, October 10th, 2023!

From my own research, it looks to be something as simple as having the window zoomed to a non-default value (i.e. you changed it from 'actual' to 'zoom in' or 'zoom out' at some point in the past), then--and this I don't know specifically what--something 'corrupts' the rendering and the text gets cut off. Perhaps changing themes in this state? Again, not sure.

But once in this 'corrupt' state where the text is cut off, the issue survives theme changes, css changes, app restarts, machine reboots, all of it.

BUT... if you adjust the window zoom back to 'actual' again, it suddenly 'fixes' itself, then it's displayed perfectly with all text shown. And this too persists now correctly across theme changes, reboots, etc.

So... it appears there's a flaw somewhere in the logic for window zoom in your app that somehow gets something out of syncing that's getting persisted to disk. But again, resetting the zoom to 'actual size' fixes it, so a) there's a simple fix/workaround, and b) hopefully that's enough for you to know where to look further into this issue so it can be fixed properly.

Personally, I'd start with messing with the window zoom, then switching themes with a non-standard value to see if you can get it in the 'corrupt' state. Then capture all persisted state on disk. Next, reset the window zoom back to 'actual size' and again, capture any state on disk. Run a diff between those two and it should show you exactly what's causing the issue.

abnerlee commented 9 months ago

relates https://github.com/mermaid-js/mermaid/issues/5122