tibirna / qgit

Official git repository for QGit.
Other
175 stars 68 forks source link

QPixmap already takes the device's pixel ratio into account #86

Closed muffato closed 4 years ago

muffato commented 4 years ago

Platform information

Operating System: Kubuntu 19.10 KDE Plasma Version: 5.17.5 KDE Frameworks Version: 5.66.0 Qt Version: 5.12.4 Kernel Version: 5.3.0-29-generic OS Type: 64-bit Processors: 4 × Intel® Core™ i7-7500U CPU @ 2.70GHz Memory: 15.5 GiB of RAM

It's a Dell XPS laptop running the stock Kubuntu with the KDE backports. My laptop screen is 3200x1800 which I scale 1.5x in the System Settings.

Problem

qgit shows a gap between the tag / branch labels and the log message: Screenshot_20200206_235056

The gap looked to about half the size of the label, so I got the idea it was linked to the scaling factor

Proposed solution

I think because pixmapSize above already takes the device pixel ratio into account we don't need to set it again on newPm. This seems to work on my laptop: Screenshot_20200206_235302 but ...

Next problem

If you look closely you will see that the labels look less sharp with my "fix". If you look at the green box for master, it's about 80px wide in my screenshots, and it feels like the text has now been generated at a smaller resolution, and probably up-scaled 1.5x.

What do you think ? I'll try to play with the various size variables if I can find another fix.

Regards, Matthieu

muffato commented 4 years ago

Oh, actually I've just realised I've been mixing several bugs.

I can see three bugs:

  1. on v2.8: there is a gap between the labels and the log message
  2. on v2.9: the label backgrounds are truncated, making a gap similar to the bug n°1
  3. on v2.9 with my change: the labels are drawn at a lower resolution

From the git history, it doesn't seem you maintain older branches such as 2.8, so I will try to find a solution for the bugs n°2 and 3 on master. If you've got any pointer, that would help :)

Regards, Matthieu