From 06cfaea3b3920592877504325da4cf429e5cf64b Mon Sep 17 00:00:00 2001
From: BojanKverh <bojan.kverh@gmail.com>
Date: Fri, 29 Jul 2016 21:59:48 +0200
Subject: [PATCH] Fixed maximal font size

--HG--
branch : feature
---
 src/libs/vlayout/vtextmanager.cpp | 3 ++-
 src/libs/vlayout/vtextmanager.h   | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/libs/vlayout/vtextmanager.cpp b/src/libs/vlayout/vtextmanager.cpp
index ee1a7cb04..62de75761 100644
--- a/src/libs/vlayout/vtextmanager.cpp
+++ b/src/libs/vlayout/vtextmanager.cpp
@@ -138,12 +138,13 @@ bool VTextManager::IsBigEnough(qreal fW, qreal fH, int iFontSize)
         TextLine tlOut = tl;
         fnt.setPixelSize(iFontSize + tl.m_iFontSize);
         QFontMetrics fm(fnt);
+        int iHorSp = fm.width(" ");
         tlOut.m_iHeight = fm.height();
         QStringList qslLines = SplitString(tlOut.m_qsText, fW, fm);
         for (int iL = 0; iL < qslLines.count(); ++iL)
         {
             // check if every line fits within the label width
-            if (fm.width(qslLines[iL]) + 2*GetSpacing() > fW)
+            if (fm.width(qslLines[iL]) + iHorSp > fW)
             {
                 return false;
             }
diff --git a/src/libs/vlayout/vtextmanager.h b/src/libs/vlayout/vtextmanager.h
index aea6741ab..e2f18e254 100644
--- a/src/libs/vlayout/vtextmanager.h
+++ b/src/libs/vlayout/vtextmanager.h
@@ -9,7 +9,7 @@
 #include "../ifc/xml/vabstractpattern.h"
 
 #define MIN_FONT_SIZE               12
-#define MAX_FONT_SIZE               128
+#define MAX_FONT_SIZE               1024
 
 /**
  * @brief The TextLine struct holds the information about one text line