-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
The linenumber is not displayed properly #17319
Comments
@dalthviz, could you put the cursor in a given line (not in the first ten) and upload another screenshot? I think the problem is with the current line. |
If you zoom in and out, does it fix it? |
You can check the height and leading by adding in
On mac I get Maybe using |
Could you try: #17321 |
from qtpy.QtGui import QFontMetricsF
fm = QFontMetricsF(font)
print(fm.lineSpacing(), fm.height(), fm.leading()) The result of code is 16.0, 17.0, -1.0. |
The font is supposed to be the same. I tried to match the stylesheet as that might affect the line spacing. |
Thanks for checking! What if you change the font? Maybe there is an issue with negative leading? Could you select a font without negative leading? |
You're right. Linenumber is working well when using some font. But It is not working when I use "JetBrains Mono", "Ubuntu mono", "Fira Mono". |
From the picture above, the baseline to baseline disctance of the line number is 32px (=2 * 16) while the baseline to baseline distance of the text is 34px ( = 2 * 17). So it looks like the editor is somehow not respecting the leading of the font? One solution could be to remove the optimisation when the leading is negative. The editor will be slower but at least the line numbers will be aligned. |
#17321 should work now (but slower when the leading is not 0) |
Description
What steps will reproduce the problem?
Hello!
Thank you for your efforts to speed up the editor.
However, The line number does not seem to be displayed normally in the latest version.
Please check it out.
Have a good day.
Versions
Dependencies
The text was updated successfully, but these errors were encountered: