profile: recreate the profile view when changing font size

Thus, we can keep the scale factor constant during existence
of the view. For now, this is simpler than adapting existing
text elements. We might want to make this more flexible later.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-05-31 21:57:39 +02:00 committed by Dirk Hohndel
parent e844b8dcad
commit 5df0efbc7f

View file

@ -160,7 +160,8 @@ void QMLProfile::setDevicePixelRatio(qreal dpr)
{
if (dpr != m_devicePixelRatio) {
m_devicePixelRatio = dpr;
m_profileWidget->setFontPrintScale(fontScale * dpr);
// Recreate the view to redraw the text items with the new scale.
createProfileView();
updateDevicePixelRatio(dpr);
emit devicePixelRatioChanged();
}