Notepad2e
Notepad2e copied to clipboard
Graphical artifacts in Indentation Guides
Open a file with different indentation and Guides enabled, then repeatedly press F5 to reload it. You will notice all kinds of glitches in how vertical lines are painted - dashed, solid, different colors, etc.
May be related to enabled UseDirectWrite (#256), although I didn't test with it off.
Addressed in 94f839dc in master-branch.
For the record:
Only occurs on the specific machine (Win10 1607, Intel UHD Graphics 620, driver 3.20.16.4973, 1920x1080, 100% DPI). Doesn't happen with UseDirectWrite off (when Scintilla uses GDI). Only happens in certain combination of settings and file layout:
- Sample.txt
- INI.txt - the only non-default settings required to trigger the bug (for example,
HighlightSelectionandHighlightCurrentLinehave no effect on the issue butViewWhiteSpace=0(even changed on runtime with Ctrl+Shift+7), orWordWrap=0make the issue disappear)
Notepad2e.exe /f C:\Absolute...\INI.txt Sample.txt
Happens when F5 is pressed or window is resized (but having caret at the beginning of file seems to trigger it more often). If the problem is visible, putting another window on top (even if it obscures it only partially) causes a redraw that removes the artifacts (not only under the obscured part but in the entire window, you don't even have to move the window away to see it). With the glitch visible, doing wheel scroll does not fix it, rather newly appeared lines (that were behind the scroll bar) have bogus guides too.
We have tested various commits (including 1c36b48) and versions (x86 regular and ICU). Happens on the earliest Notepad 2e commit as well as Notepad2 (4.2.25) if you recompile the code with enabled DirectWrite. Does not happen on our regular x64 build. Does not happen in latest Scintilla (3.21.1) with latest SciTE (3.7.5) with a similar configuration, or in Scintilla (3.11.2, our current version) with SciTE (3.7.5). After compiling Notepad 2e with different Scintilla's technology, discovered that 0 (GDI) has no problem, 1/2 have the same problem, 3 (DIRECTWRITEDC) has the problem but it occurs 10 if not 100 times less often (but still occurs).
We were unable to reliably identify the cause but adding EndDraw() methods in Scintilla to pair BeginDraw() removes the glitch with Guides. Looks like Flush() alone is not enough and junk appears on the surface with the guides (and maybe others that are harder to spot). Still, at rare times a piece of cyan junk continues to appear at some random position within the document area (this happened before and is seemingly unaffected by this change).