ucam-department-of-psychiatry / camcops

Cambridge Cognitive and Psychiatric Test Kit (CamCOPS)
Other
12 stars 8 forks source link

Potential client icon distortion under Linux, sometimes #332

Open RudolfCardinal opened 8 months ago

RudolfCardinal commented 8 months ago

Under Linux, as of Jan 15 2024 on the qt6 branch, there appears to be some icon distortion on some systems, looking like mis-scaling to 51x51 px (from an original icon size of 96x96 px -- expected e.g. 48x48 px?). For example:

The icons are being created in QuestionnaireHeader::QuestionnaireHeader() by ImageButton(), with no size specified, so I think it's going via uifunc::getPixmap(). I've not tracked through to remind myself of the full process but there is

// in uiconst.cpp
const Dpi DEFAULT_DPI(96, 96);  // standard for monitors

Dpi g_logical_dpi = DEFAULT_DPI;
Dpi g_physical_dpi = DEFAULT_DPI;

const QSize ICONSIZE_FOR_DEFAULT_DPI(48, 48);

const QSize SMALL_ICONSIZE_FOR_DEFAULT_DPI(48, 48);

QSize g_iconsize = ICONSIZE_FOR_DEFAULT_DPI;

QSize g_small_iconsize = SMALL_ICONSIZE_FOR_DEFAULT_DPI;

etc. – however, forcing physical DPI to 96,96 in settings and restarting doesn't seem to make a visual difference either, and is still scaling to about 51x51. (Scaling to 51 is a bit funny; I'd expect 48 and then I imagine it'd look better.) Maybe it's looking at physical DPI as reported by the OS and not overriding it somewhere.

Not observed elsewhere, even on other Linux systems -- parked for now.

icon_distortion_01 icon_distortion_02 icon_distortion_03 icon_distortion_04 icon_distortion_05

RudolfCardinal commented 8 months ago

From the perspective of a setup with no distortion:

Your icons appear to be displayed 51px square. Mine are 48px. On the iPad they look lower resolution but not jagged and are drawn at 72px square.