-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Numbers are cut off on bottom of Spectrum Analyzer #5088
Comments
Hi, What happens, as far as I can tell, is that Qt first looks up the screen DPI and it is applied to correctly scale all elements (labels, buttons, windows, ...), say, by 1.5. Then Xfce tells it "hey, I've got this custom 1.5 scale for fonts, you should use it". And it does -- in my case, the extra scaling is even applied to buttons and other things, in your case the "damage" seems to be somewhat limited. Running lmms as: |
Hi @he29-net, I still think that you can use
This more or less asks the painter: "If I use your current font to render the string Then I set a breakpoint after the So I still think that the value of |
Should be fixed with #5098. I have tested the fix with different settings for |
This should now be fixed in recent builds that use Qt 5.6, which fixes (at least some of) the scaling issues. The fonts are still obviously fixed size, but that should not be an issue -- scaling the font size and other GUI elements with DPI is the job of Qt, it just needs to actually do it properly, which it now apparently does. :) |
@he29-net Do you want to close this issue? |
I think it can be closed, unless someone knows of an instance where the problem still occurs. I believe the issue was fixed by the Qt upgrade, and I would expect scaling support to only get better and more stable in future Qt versions, not worse. There is also the WIP PR that re-writes the UI to be immune to the cut-off problems (although it won't prevent Qt from using bad font size), which can still link to this issue for reference even after it was closed. |
The problem is still present on my machine: This was compiled with Qt 5.14 by the way and I still believe that it is not a problem with Qt. If you paint something in the paint methods of Qt it will paint what you tell it to. The open pull request 5098 shows that the problem can be solved and how. |
Well, apparently not, which is the problem. I tell it to draw text of certain size in "Qt logical pixels", which is a valid thing to do if you want to make any sort of pixel-perfect, fixed-size interface (which is also defined in Qt logical pixels). It works as expected most of the time, but it seems that in some cases it messes up the font size vs. DPI adjustment and scales the text to about double the size that it should be. That is a Qt problem: imagine the text was drawn over a bitmap background -- this bug makes such a use-case completely unusable, since you can't dynamically adjust parts of the bitmap to fit whatever text size Qt decides to draw. The fact that the numbers are cut off at the bottom is only a symptom; the underlying problem is that the numbers are huge, which is causing other problems (like 10k and 20k labels nearly overlapping). I think there are at least three environment variables that affect Qt scaling (probably many more), and all the window managers and platforms could be setting them to any combination of values, which is likely causing the issues. The AppImage should be forcing them to "sane values", so LMMS releases should hopefully behave well. But I'm not sure if the underlying issue even can be fixed for source builds, as we have no control over the environment variables. So perhaps mitigating the issue by fixing some of the symptoms like in #5098 is the best we can do, I don't know... |
I'm running everything with |
If I manually break LMMS scaling with |
Closing this issue as I cannot reproduce it anymore even when using |
The numbers at the bottom of the spectrum analyzer are cut off if used on a display with a higher DPI:
This is caused by the hard coded width and height in
SaSpectrumView::drawGrid
:One solution is to measure the strings you want to write using
QFontMetrics
and then make space and position the labels accordingly.The text was updated successfully, but these errors were encountered: