From 5df0efbc7f63108516fac040866fbd70cd2950e0 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Mon, 31 May 2021 21:57:39 +0200 Subject: [PATCH] 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 --- profile-widget/qmlprofile.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/profile-widget/qmlprofile.cpp b/profile-widget/qmlprofile.cpp index 35ab82ba1..3d664c9a3 100644 --- a/profile-widget/qmlprofile.cpp +++ b/profile-widget/qmlprofile.cpp @@ -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(); }