-
-
Notifications
You must be signed in to change notification settings - Fork 850
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
Scale lines according to screen font size #4071
Conversation
Great PR! Please pay attention to the following items before merging: Files matching
This is an automatically generated QA checklist based on modified files. |
|
6a793f6
to
1637c22
Compare
OK, this makes sense, since I already was passing an instance of Anyway, I've updated the PR. |
With these changes, and a fix to make line strips & loops joined (in a miter joint style) I'm gonna push soon, I've been able to make the following version of the book cover. I'm sure Alex can make a better composition, and I forgot to enable constellation names, but notice how much crisper it looks compared to the current state at 100% scale. And when encoded in JPEG with 95% quality (via ImageMagick) it is even smaller in file size (compared to the current PNG)! |
3fe9709
to
71910a1
Compare
The current link of screen font size and button size is a bit unbalanced IMO, buttons too large or bottom bar text too small. Is there a way to either fully decouple or add some relative scaling factor? |
Do you mean you dislike the relation between the default sizes of 13px font and 32px buttons and want to use a different ratio? I suppose this is possible to implement by adding a factor into |
Yes, please. |
OK, but this is unrelated to this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
OK then, will be a new issue soon. Else no current objections. |
Description
Currently lines (constellations, DSO markers etc.) are scaled in thickness according to device pixel ratio. I'm continuing the work on basing this on font scale instead.
This PR uses a product of device pixel ratio and font size ratio to yield the final scaling coefficient of the lines (and dotted DSO markers). For this, a function called
screenScale
is introduced in bothConstellationMgr.cpp
andNebula.cpp
. It's rather simple, but I'd rather not repeat its implementation everywhere, so I have a question: where is the best place for it?StelApp
, or maybeStelSkyDrawer
, orStelPainter
orStelProjector
? It seemsStelApp
is too general a place for an OpenGL-rendering-specific coefficient, but OTOH, after we get rid of the Qt scaling kludge, this function will be simplified to justStelApp::screenFontSizeRatio()
. AndStelSkyDrawer
doesn't appear to have getters for such low-level factors. Not sure aboutStelPainter
orStelProjector
either.Type of change
How Has This Been Tested?
Test Configuration:
Checklist: