New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Document Map" view is rendered at wrong place in 7.8.9 #8575
Comments
@Ekopalypse I cannot reproduce what you reported on my Windows 10 PC. It may related only to Windows 7 ? |
@donho, I fired up my Windows 10 Virtualbox image and can confirm that I do not see the shadow coming out either. |
We have two different effects here. The first one (reported by @gnaggnoyil) I cannot reproduce. The first questions here would be:
The second one (reported by @Ekopalypse) is an effect of word wrapping alone. The width of the Scintilla edit window portion of the Document Map is calculated arbitrarily. The goal is to match the length of lines expected in the Document Map and not the actual width of the Document Map. That's why the Scintilla edit window portion of the Document Map is most times smaller than the Document Map itself. But, if the Document Map width is reduced too much, then this Scintilla edit window portion is wider than the Document Map itself. In this case, and under Windows 7 only, the transparent overlay of the Document Map gets visible outside the Notepad++ window. Under Windows 10, the transparent overlay of the Document Map is a child window (which is impossible under Windows 7), that's why it cannot leave the bounds of Notepad++. My first private thought to solve the problem with the word-wrapped Document Map was: Do not wrap the Document Map at all, even if word wrap is turned on. I tested it, and for me the results were OK. What I got, was a word wrapped edit window, and a not wrapped Document Map, in which the range visible in the edit window was marked orange. So my proposal would be: Never wrap text in the Document Map. If the edit view is wrapped, it displays not exactly what is stored in the file. So let the Document Map show the reality. Of course, this can go to extremes with documents containing a single long line for example, but on the other hand, especially in those cases it may be helpful to see the reality. My opinion: It is nearly impossible to get the Document Map wrapped at the same positions as the text document in the edit window. It depends on too many factors, like syntax highlighting and font sizes. The only way I could imagine (but not implement) is to collect all word wrapping points from the edit window and apply them manually to the Document Map, which will become a time consuming process on large documents. |
@Uhf7 Thanks for your reply here! No, the misplaced effect does not go away when the window is resized or moved, and will always show in the middle of the window. I'm not sure if it's related to Windows 10 version, for I haven't tested on other Windows 10 versions yet. Do I need to try on some other Windows 10 versions? |
@gnaggnoyil Thank you for testing. I just got another thought. Your screen shot is 1756 pixels high, so you possibly have one of those new displays with 4K resolution. Windows tends to scale apps on those displays automatically. Perhaps the effect goes in this direction. So the next questions are:
This Disable option can be found as follows (at least in the 1607 Windows version):
It looks like this (the .exe name is modified in my test environment): |
@Uhf7 - I'm certainly no c++ programmer but I think the DocumentMap is basically a cloned view of the current document. So there's nothing to calculate, is there? |
@Ekopalypse I think it's more complicated. The word wrapping mechanic of Scintilla is that you set wrap mode on ( What Notepad++ tries here, is to calculate the window width of the Scintilla portion of the Document View using the ratio between the font size of the edit window and the font size of the Document Map. And then, the Scintilla portion of the Document Map is set to this calculated width. And then it is expected, that Scintilla wraps the text at the same points as in the original edit window. This cannot work in my opinion, which is backed up by numerous experiments on my side. If I had found a way to solve this, I would happily created a PR showing how to do it. So, why it cannot work (in my opinion at least)? I cannot explain it very well, I always felt, that the Document Map stuff is difficult. So I try to construct the following example:
The result of this are different wrapping points in the original edit view and the tiny Document Map view. This occurred constantly in my tests, so I eventually gave up the wrapped view, which means, I accepted that it can only be an approximation. My proposal remains, don't ever wrap the Document Map, you get much more information seeing reality there than the approximated wrapped view does provide. |
@Uhf7 - thanks for clarification and you are correct. Seems it isn't as easy as I was assuming. |
|
@gnaggnoyil Thank you for the detailed information, now I have a hint from which direction the problem comes. There is one thing I still don't understand: Why is the transparent window able to leave the document map at all? I can simulate the effect by pretending to Notepad++ that it does not run under Windows 10. Then, the transparent window is no child window, and only then I can display it at the wrong position shown in your screen shot. Seems as if I have to update my Windows to find out more. |
Found a system with a monitor 3840 x 2160 and Windows version 1909, debug info like this:
It is not my system, but I could use it long enough to confirm the wrong placement of the transparent part of the Document Map, when the new "System (Enhanced)" scaling mode is active. Investigating further, it turned out, that this seems to be a bug in Windows itself. I made me a small a test program to confirm this. This test program created a transparent child window, and then switched the Simultaneously, I watched the Windows messages with Spy++ and the results of
In the moment, I'm unable to remove this effect by modifying the Notepad++ code. There were only two solutions working on this test system:
|
@Uhf7 Thanks for your detailed explaination! Confirmed setting windows 8 compatibility acts as a working workaround. |
Description of the Issue
The overlay shade effect of the Document Map view is rendered at middle of the whole window, rather than its original place
Steps to Reproduce the Issue
Expected Behavior
Document Map view shall have all its effects in right place
Actual Behavior
Debug Information
The text was updated successfully, but these errors were encountered: