From 561fadb4f23421273c755b2b4058ec09b24a70ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Sat, 29 Jun 2019 10:27:12 +0200 Subject: [PATCH] Do not resize the font on every usage --- src/map/imgmap.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/map/imgmap.cpp b/src/map/imgmap.cpp index d32decf3..06e312c1 100644 --- a/src/map/imgmap.cpp +++ b/src/map/imgmap.cpp @@ -102,13 +102,19 @@ static int minPOIZoom(Style::POIClass cl) } } +static QFont font(int pixelSize) +{ + QFont f; + f.setPixelSize(pixelSize); + return f; +} + /* The fonts must be initialized on first usage (after the QGuiApplication instance is created) */ #define FONT(name, size) \ static const QFont *name() \ { \ - static QFont f; \ - f.setPixelSize(size); \ + static QFont f = font(size); \ return &f; \ }