mobile/profile: fix scaling of profile for HDPI screens

For reasons I don't understand, the device pixel ratio was taken into account
twice. And as a result the transformation applied to the profile made us show
only the top left part of it - but enlarged (depending on the DPR).

This code fixes that problem by simply forcing the transformation used by the
painter to be the identity matrix. I worry that this could be wrong in some
situations, but for now it seems to fix the problem.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2022-02-27 13:09:35 -08:00
parent 83d6143f97
commit f8eb5140e2
2 changed files with 4 additions and 0 deletions

View file

@ -1,4 +1,5 @@
- core: avoid crash with corrupted cloud storage
- mobile: fix profile scaling issue on high DPR devices
- mobile/Android: add logfiles as attachment to support emails
- planner: make ESC (cancel plan) work when moving handles
- dive list: make dive guide visible in dive list [#3382]

View file

@ -51,7 +51,10 @@ void QMLProfile::paint(QPainter *painter)
timer.start();
// let's look at the intended size of the content and scale our scene accordingly
// for some odd reason the painter transformation is set up to scale by the dpr - which results
// in applying that dpr scaling twice. So we hard-code it here to be the identity matrix
QRect painterRect = painter->viewport();
painter->resetTransform();
if (m_diveId < 0)
return;
struct dive *d = get_dive_by_uniq_id(m_diveId);